Advertisement
Travonrodfer

Deathmatch com outro cn

Aug 10th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. -- Deathmatch com outro cn
  2.  
  3. cn = 1704 -- id do item que você quer que lance.
  4. tempo = 1000 -- o tempo que você quer pro item sumir
  5. velocidade = 40 -- a velocidade da direita
  6. velocidadee = -40 -- a velocidade da esquerda
  7.  
  8. -- Aqui pra baixo não é editavel.
  9.  
  10. despawn = {}
  11. function eventKeyboard(name, key, down, x, y)
  12. if key == 76 then
  13. local facingRight = tfm.get.room.playerList[name].isFacingRight
  14. table.insert(despawn, {tfm.exec.addShamanObject(cn, facingRight and x + 8 or x - 8, y - 7, facingRight and 90 or -90, facingRight and velocidade or velocidadee), os.time()})
  15. end
  16. end
  17.  
  18. function eventLoop(ainda, acaba)
  19. for i,v in ipairs(despawn) do
  20. if v[2] < os.time() - tempo then
  21. tfm.exec.removeObject(v[1])
  22. table.remove(despawn, i)
  23. end
  24. end
  25. end
  26.  
  27. for all in pairs(tfm.get.room.playerList) do
  28. tfm.exec.bindKeyboard(all, 76, true, true)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement