Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. toDespawn={}
  2.  
  3. function eventNewPlayer(n)
  4. system.bindKeyboard(n, 3, true, true)
  5. end
  6.  
  7. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  8.  
  9. function eventKeyboard(n,key,down,Px,Py)
  10. if key == 3 and not tfm.get.room.playerList[n].isDead then
  11. local id=tfm.exec.addShamanObject(10, Px+(tfm.get.room.playerList[n].isFacingRight and 5 or -5), Py-3, 0, 20, 0)
  12. table.insert(toDespawn,{os.time(),id})
  13. end
  14. end
  15.  
  16. function eventLoop()
  17. for i,cannon in ipairs(toDespawn) do
  18. if cannon[1] <= os.time()-1500 then
  19. tfm.exec.removeObject(cannon[2])
  20. table.remove(toDespawn,i)
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement