Noneatme

Untitled

May 26th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1.  
  2. local state = false
  3. local nstate = false
  4. local sx = 0
  5. bindKey("Key", "down", function()
  6.     state = true
  7.     nstate = 1
  8. end)
  9.  
  10. bindKey("Key", "up", function()
  11.     state = false
  12.     nstate = 0
  13. end)
  14.  
  15. addEventHandler("onClientRender", getRootElement(), function()
  16.     if(nstate == 1) then
  17.         if(sx < 100) then
  18.             sx = sx+2
  19.         end
  20.     end
  21.     if(nstate == 0) then
  22.         if(sx > 0) then
  23.             sx = sx-2
  24.         end
  25.     end
  26.     local x, y = guiGetScreenSize()
  27.     dxDrawImage(x/2, y-sx, "dateiname.png")
  28. end)
Advertisement
Add Comment
Please, Sign In to add comment