Brenower

[TFM][Brenower] Ser um balão

Jan 14th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. -- Ser um balão
  2. -- Créditos:Brenower
  3. -- Tables
  4. data={};
  5. -- Inicio do script
  6. for i in pairs(tfm.get.room.playerList) do
  7. nD={
  8. ["id"]=id;
  9. ["c"]=fale;
  10. ["win"]=false;
  11. };
  12. data[i] = nD;
  13. id=tfm.exec.addShamanObject(28,0,0)
  14. data[i].id = id
  15. tfm.exec.bindKeyboard(i,32,false,true)
  16. tfm.exec.bindKeyboard(i,40,false,true)
  17. end
  18. -- Eventos do teclado
  19. function eventKeyboard(player,key,down,x,y)
  20. if y >= 0 and y <= 400 and x >= 0 and x <= 800 and data[player].win == false then
  21. if tfm.get.room.playerList[player].isDead then
  22. tfm.exec.respawnPlayer(player)
  23. tfm.exec.movePlayer(player,tfm.get.room.objectList[data[player].id].x,tfm.get.room.objectList[data[player].id].y)
  24. if data[player].c == true then
  25. tfm.exec.giveCheese(player)
  26. end
  27. end
  28. if not tfm.get.room.playerList[player].isDead then
  29. id=tfm.exec.addShamanObject(28,x,y,0,0,0,true)
  30. tfm.exec.removeObject(data[player].id)
  31. data[player].id = id;
  32. tfm.exec.killPlayer(player)
  33. end
  34. end
  35. end
  36. -- Jogador pega o queijo
  37. function eventPlayerGetCheese(player)
  38. data[player].c = true;
  39. end
  40. -- Jogador entra na toca
  41. function eventPlayerWon(player)
  42. data[player].win = true;
  43. end
Advertisement
Add Comment
Please, Sign In to add comment