Advertisement
Eliaseeg

[Pedidos de scripts] Velocidad para los ratones

Jan 28th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. --!speed para que los ratones puedan tener algo de velocidad
  2. --!speedoff para que ya no tengan velocidad
  3.  
  4. velocidad=false
  5.  
  6. function eventChatCommand (playerName, command)
  7. if command == "speed" and velocidad==false then
  8.  print("<BV>Velocidad encendida")
  9.   velocidad=true
  10. elseif command == "speedoff" and velocidad==true then
  11. print("<R>Velocidad apagada")
  12. velocidad=false
  13. end
  14. end
  15.  
  16. function eventLoop(curTime, timeR)
  17.    if velocidad==true then
  18.     for player in pairs(tfm.get.room.playerList) do
  19.        if(tfm.get.room.playerList[player].movingLeft) then
  20.        tfm.exec.movePlayer(player,nil,nil,false,-100,nil,false)
  21.        else if(tfm.get.room.playerList[player].movingRight) then
  22.        tfm.exec.movePlayer(player,nil,nil,false,100,nil,false)
  23.            end
  24.            end
  25.            end
  26.            end
  27. end
  28.  
  29. --Si quieres que todos los ratones empiecen ya teniendo velocidad, pues es esto:
  30.  
  31. function eventLoop(curTime, timeR)
  32. for player in pairs(tfm.get.room.playerList) do
  33.        if(tfm.get.room.playerList[player].movingLeft) then
  34.        tfm.exec.movePlayer(player,nil,nil,false,-100,nil,false)
  35.        else if(tfm.get.room.playerList[player].movingRight) then
  36.        tfm.exec.movePlayer(player,nil,nil,false,100,nil,false)
  37.            end
  38.            end
  39.            end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement