Advertisement
KananGamer

[TFM-LUA] Script que me pediram

Jan 25th, 2019
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. --[[
  2.     Author(s): Nettoork#0000
  3. ]]--
  4.  
  5. local objects = {}
  6.  
  7. eventNewPlayer = function(name)
  8.     tfm.exec.bindKeyboard(name, 32, true, true)
  9. end
  10.  
  11. eventLoop = function()
  12.     local toRemove = {}
  13.     for i, v in next, objects do
  14.         if v[2] < os.time() then
  15.             toRemove[#toRemove + 1] = i
  16.         end
  17.     end
  18.     for i, v in next, toRemove do
  19.         if objects[v] then
  20.             tfm.exec.removeObject(objects[v][1])
  21.             table.remove(objects, v)
  22.         end
  23.     end
  24. end
  25.  
  26. eventKeyboard = function(username, key, down, x, y)
  27.     local data = tfm.get.room.playerList[username]
  28.     if key == 32 and not data.isDead then
  29.         objects[#objects + 1] = {tfm.exec.addShamanObject(35, data.isFacingRight and x + 20 or x - 20, y-10, data.isFacingRight and 0 or 180,  data.isFacingRight and 35 or -35), os.time() + 5000}
  30.     end
  31. end
  32.  
  33. table.foreach(tfm.get.room.playerList, eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement