Jump to content

Doesnt work.


Sex*

Recommended Posts

So i got a script but doesnt work, debugscript nothing.

sX, sY = guiGetScreenSize() 
local scale = sX / 1920 * (sY / 1200) 
local animBar = false 
local bindBlock = true 
drawComponents = false 
window = { 
  sX / 2 - 300, 
  sY / 2 - 200 
} 
animate = { 
  alpha = 1, 
  barSize = { 
    sX, 
    sY / 7 
  }, 
  pos = {0, sX}, 
  title = { 
    "STATS", 
    "ACHIEVEMENTS", 
    "MAP SHOP", 
    "TOP LIST", 
    "OPTIONS" 
  }, 
  fontScale = 4 * scale, 
  font = "default-bold", 
  anim = false, 
  tick = getTickCount() 
} 
local barFix = 0 
for i = 1, #animate.title do 
  barFix = barFix + dxGetTextWidth(animate.title[i], animate.fontScale, animate.font) 
end 
local barFix = (sX - barFix) / #animate.title 
bar = { 
  buttonSize = { 
    dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + barFix, 
    dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + barFix, 
    dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + barFix, 
    dxGetTextWidth(animate.title[4], animate.fontScale, animate.font) + barFix, 
    dxGetTextWidth(animate.title[5], animate.fontScale, animate.font) + barFix 
  }, 
  buttonSizeY = sY / 13, 
  buttonPos = { 
    0, 
    dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + barFix, 
    dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + barFix * 2, 
    dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + barFix * 3, 
    dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[4], animate.fontScale, animate.font) + barFix * 4 
  }, 
  buttonPosY = { 
    animate.pos[2], 
    animate.pos[2], 
    animate.pos[2], 
    animate.pos[2], 
    animate.pos[2] 
  }, 
  lastButton = 0, 
  currentAnimate = 0, 
  hover = 0, 
  currentWindow = 0 
} 
function drawBottomBar() 
  for i = 1, #bar.buttonSize do 
    dxDrawRectangle(bar.buttonPos[i], bar.buttonPosY[i], bar.buttonSize[i], animate.barSize[2], tocolor(20, 20, 20, 100)) 
    dxDrawLine(bar.buttonPos[i], bar.buttonPosY[i] + 2, bar.buttonPos[i] + bar.buttonSize[i], bar.buttonPosY[i] + 2, tocolor(100, 100, 100, 200), 2) 
    dxDrawLine(bar.buttonPos[i], bar.buttonPosY[i], bar.buttonPos[i], bar.buttonPosY[i] + animate.barSize[2], tocolor(100, 100, 100, 200), 2) 
    dxDrawLine(bar.buttonPos[i] + bar.buttonSize[i] - 2, bar.buttonPosY[i], bar.buttonPos[i] + bar.buttonSize[i] - 2, bar.buttonPosY[i] + animate.barSize[2], tocolor(100, 100, 100, 200), 2) 
    dxDrawText(animate.title[i], bar.buttonPos[i] + 1, bar.buttonPosY[i] + 1, bar.buttonPos[i] + bar.buttonSize[i] + 1, bar.buttonPosY[i] + bar.buttonSizeY + 1, tocolor(0, 0, 0, 255), animate.fontScale, animate.font, "center", "center") 
    dxDrawText(animate.title[i], bar.buttonPos[i], bar.buttonPosY[i], bar.buttonPos[i] + bar.buttonSize[i], bar.buttonPosY[i] + bar.buttonSizeY, tocolor(15, 192, 252, 255), animate.fontScale, animate.font, "center", "center") 
  end 
end 
addEventHandler("onClientRender", getRootElement(), drawBottomBar) 
function animateBar() 
  if not animBar then 
    if not bindBlock then 
      callServerFunction("unlockAch", getLocalPlayer(), 14) 
      showCursor(true) 
      animBar = true 
      animate.tick = getTickCount() 
      addEventHandler("onClientRender", getRootElement(), animateToolbar) 
      end 
end 
bindKey("F7", "down", animateBar) 
end 
function checkHoverTab() 
  if isCursorShowing() and animate.anim then 
    local x, y = getCursorPosition() 
    local x, y = x * sX, y * sY 
    if x >= bar.buttonPos[1] and x <= bar.buttonPos[1] + bar.buttonSize[1] and y >= bar.buttonPosY[1] then 
      animateButton(1) 
      bar.hover = 1 
    elseif x >= bar.buttonPos[2] and x <= bar.buttonPos[2] + bar.buttonSize[2] and y >= bar.buttonPosY[2] then 
      animateButton(2) 
      bar.hover = 2 
    elseif x >= bar.buttonPos[3] and x <= bar.buttonPos[3] + bar.buttonSize[3] and y >= bar.buttonPosY[3] then 
      animateButton(3) 
      bar.hover = 3 
    elseif x >= bar.buttonPos[4] and x <= bar.buttonPos[4] + bar.buttonSize[4] and y >= bar.buttonPosY[4] then 
      animateButton(4) 
      bar.hover = 4 
    elseif x >= bar.buttonPos[5] and x <= bar.buttonPos[5] + bar.buttonSize[5] and y >= bar.buttonPosY[5] then 
      animateButton(5) 
      bar.hover = 5 
    else 
      animateButton(0) 
      bar.hover = 0 
    end 
  end 
end 
addEventHandler("onClientRender", getRootElement(), checkHoverTab) 
function onPlayerButtonClick(button, state) 
  if button == "left" and state == "down" and isCursorShowing() and bar.hover ~= 0 then 
    toggleWindow(bar.hover) 
  end 
end 
addEventHandler("onClientClick", getRootElement(), onPlayerButtonClick) 
animateWindow = {} 
function toggleWindow(id) 
  if bar.currentWindow ~= id then 
    bar.currentWindow = id 
    animateWindow.tick = getTickCount() 
  else 
    bar.currentWindow = 0 
  end 
end 
function drawWindow() 
  if bar.currentWindow ~= 0 then 
    local tick = getTickCount() - animateWindow.tick 
    local progress = tick / 1000 
    if progress >= 1 then 
      progress = 1 
      drawComponents = true 
    else 
      drawComponents = false 
    end 
    windowX, windowY = interpolateBetween(0, 0, 0, 600, 400, 0, progress, "OutElastic") 
    dxDrawRectangle(sX / 2 - windowX / 2, sY / 2 - windowY / 2, windowX, windowY / 14, tocolor(0, 0, 0, 150)) 
    dxDrawRectangle(sX / 2 - windowX / 2, sY / 2 - windowY / 2, windowX, windowY, tocolor(0, 0, 0, 200)) 
  end 
end 
addEventHandler("onClientRender", getRootElement(), drawWindow) 
local currentTick = getTickCount() 
function animateButton(id) 
  if bar.lastButton ~= id then 
    bar.lastButton = id 
    bar.currentAnimate = id 
    currentTick = getTickCount() 
  end 
  if bar.currentAnimate then 
    for i = 1, 5 do 
      if bar.currentAnimate == i then 
        do 
          local tick = getTickCount() 
          local animProgress = tick - currentTick 
          local progress = animProgress / 500 
          bar.buttonPosY[i] = interpolateBetween(bar.buttonPosY[i], 0, 0, sY - sY / 8, 0, 0, progress, "Linear") 
        end 
      else 
        local tick = getTickCount() 
        local animProgress = tick - currentTick 
        local progress = animProgress / 500 
        bar.buttonPosY[i] = interpolateBetween(bar.buttonPosY[i], 0, 0, sY - sY / 13, 0, 0, progress, "Linear") 
      end 
    end 
  end 
end 
function allowBind(bOl) 
  bindBlock = not bOl 
end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...