Advertisement
Tectoon

[TFM] Meep (Período de Teste)

Aug 15th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. meeped="Tectoon"
  2. power=350
  3.  
  4. --for k,v in pairs(tfm.get.room.playerList) do
  5.         tfm.exec.bindKeyboard("Tectoon", 32, true, true)
  6. --end
  7.  
  8. function eventKeyboard(meeper, key, down, x, y)
  9.     if key==32 then
  10.         meeper_x=x
  11.         meeped_x=tfm.get.room.playerList[meeped].x
  12.         meeper_y=y+10
  13.         meeped_y=tfm.get.room.playerList[meeped].y
  14.         xdiff=meeped_x-meeper_x
  15.         ydiff=meeped_y-meeper_y
  16.         length=math.sqrt(xdiff^2+ydiff^2)
  17.         if length <= 90 then
  18.             tfm.exec.movePlayer(meeped, 0, 0, false, (xdiff/(math.abs(xdiff)+math.abs(ydiff)))*power, (ydiff/(math.abs(xdiff)+math.abs(ydiff)))*power, false)  
  19.         end
  20.     end
  21. end
  22.  
  23. tfm.exec.newGame(2643833)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement