Advertisement
zigwin

zigwin:speed

Jan 4th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. -- lua transformice
  2. --    Speed
  3. --    ©Zigwin
  4.  
  5. admin='Zigwin'
  6. speedX=100
  7.  
  8. p='3'
  9.  
  10. for name,_ in pairs(tfm.get.room.playerList) do
  11.     tfm.exec.bindKeyboard(name,37,true,true)
  12.     tfm.exec.bindKeyboard(name,39,true,true)
  13.     tfm.exec.bindKeyboard(name,65,true,true)
  14.     tfm.exec.bindKeyboard(name,68,true,true)
  15. end
  16.  
  17. function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition)
  18.     if keyCode==68 or keyCode==39 then
  19.         tfm.exec.movePlayer(playerName,0,0,nil,tfm.get.room.playerList[playerName].vx+speedX)
  20.     elseif keyCode==65 or keyCode==37 then
  21.         tfm.exec.movePlayer(playerName,0,0,nil,tfm.get.room.playerList[playerName].vx-speedX)
  22.     end
  23. end
  24.  
  25. tfm.exec.disableAutoTimeLeft(true)
  26. tfm.exec.disableAutoNewGame(true)
  27. tfm.exec.disableAutoScore(true)
  28. tfm.exec.disableAfkDeath(true)
  29. tfm.exec.disableAutoShaman(true)
  30. tfm.exec.newGame('#7')
  31.  
  32. function eventPlayerDied(playerName) tfm.exec.respawnPlayer (playerName) end
  33. function eventNewPlayer(playerName)
  34.     tfm.exec.respawnPlayer (playerName)
  35.     tfm.exec.bindKeyboard(playerName,37,true,true)
  36.     tfm.exec.bindKeyboard(playerName,39,true,true)
  37.     tfm.exec.bindKeyboard(playerName,65,true,true)
  38.     tfm.exec.bindKeyboard(playerName,68,true,true)
  39. end
  40.  
  41. function eventChatCommand(playerName, message)
  42.     if playerName==admin then
  43.         if message:sub(1,5)=='map p' then
  44.             tfm.exec.newGame('#'..tostring(message:sub(7)))
  45.         elseif message:sub(1,3)=='map' then
  46.             tfm.exec.newGame(message:sub(5))
  47.         elseif message:sub(1,5)=='speed' then
  48.             speedX=message:sub(7)
  49.         elseif message:sub(1,4)=='next' then
  50.             tfm.exec.newGame('#'..p)
  51.         elseif message:sub(1,4)=='perm' then
  52.             p=tostring(message:sub(6))
  53.         end
  54.     end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement