Advertisement
Bloonshack

[Tfm] Chuva do mal!!!!11 (2.0) (INCOMPLETO)

Jul 27th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.68 KB | None | 0 0
  1. --Criado por Bloonshack
  2. --Dai?
  3. --^^
  4.  
  5. adm="Bloonshack"
  6.  
  7. vivo={1}
  8.  
  9.  
  10. tfm.exec.disableAutoNewGame(true)
  11. tfm.exec.disableAutoShaman(true)
  12. players={}
  13. toDespawn={}
  14. maps={[[@6782986]], [[@6782986]]}
  15.  
  16. function eventNewPlayer(name)
  17.  ui.setMapName("Down!")
  18. for i,key in ipairs({32,40,83}) do
  19. tfm.exec.bindKeyboard(name,key,true,true)
  20. end
  21. players[name]={
  22. timestamp=os.time(),
  23. offsets={x=2, y=10}
  24. }
  25. end
  26. conjurar={85}
  27. function eventKeyboard(name,key,down,x,y)
  28.  ui.setMapName("Down!")
  29. if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
  30. if players[name].timestamp < os.time()-600 then
  31. local id
  32. if tfm.get.room.playerList[name].isFacingRight then
  33. id=tfm.exec.addShamanObject(85,x+players[name].offsets.x,y+players[name].offsets.y,0,200,0)
  34. else
  35. id=tfm.exec.addShamanObject(85,x+players[name].offsets.x,y+players[name].offsets.y,0,-200,0)
  36. end
  37. players[name].timestamp=os.time()
  38. table.insert(toDespawn,{os.time(),id})
  39. end
  40. end
  41. end
  42.  
  43. function eventChatCommand(name,command)
  44.  ui.setMapName("Down!")
  45. local arg={}
  46. for argument in command:gmatch("[^%s]+") do
  47. table.insert(arg,argument)
  48. end
  49. if arg[1]=="off" then
  50. if tonumber(arg[2]) and tonumber(arg[3]) then
  51. players[name].offsets.x=tonumber(arg[2])
  52. players[name].offsets.y=tonumber(arg[3])
  53. else
  54. players[name].offsets.x=2
  55. players[name].offsets.y=10
  56. end
  57. tfm.exec.chatMessage("Offsets changed to X:"..players[name].offsets.x.." Y:"..players[name].offsets.y,name)
  58. end
  59. end
  60.  
  61. function eventNewGame()
  62. started=false
  63.  ui.setMapName("Down!")
  64. end
  65.  
  66. function eventLoop(time,remaining)
  67. if time >= 3000 and not started then
  68. started=true
  69. end
  70. if remaining<=0 then
  71. tfm.exec.newGame(maps[math.random(#maps)])
  72. end
  73. for i,cannon in ipairs(toDespawn) do
  74. if cannon[1] <= os.time()-3000 then
  75. tfm.exec.removeObject(conjurar[2])
  76. table.remove(toDespawn,i)
  77.  ui.setMapName("Down!")
  78. end
  79. end
  80. end
  81.  
  82. function eventLoop(int)
  83. miceColision=true
  84. for i=1,2,3 do
  85. tfm.exec.addShamanObject(0,500,0,0,0,0,2)
  86. tfm.exec.addShamanObject(2,500,0,0,0,10,false)
  87. tfm.exec.addShamanObject(2,1400,0,0,0,10,false)
  88.  ui.setMapName("Down!")
  89. end
  90. end
  91.  
  92. function eventPlayerDied(name)
  93. local i=0
  94. local n
  95. for pname,player in pairs(tfm.get.room.playerList) do
  96. if not player.isDead then
  97. i=i+1
  98. n=pname
  99.  ui.setMapName("Down!")
  100. end
  101. end
  102. if i==0 then
  103. tfm.exec.newGame(maps[math.random(#maps)])
  104. elseif i==1 then
  105. tfm.exec.giveCheese(n)
  106. tfm.exec.playerVictory(n)
  107. tfm.exec.setGameTime(0)
  108.  ui.setMapName("Down!")
  109. end
  110. end
  111.  
  112. for name,player in pairs(tfm.get.room.playerList) do
  113. eventNewPlayer(name)
  114. end
  115.  
  116. tfm.exec.newGame(maps[math.random(#maps)])
  117.  
  118. ui.addPopup(0, 0, "ISSO É UM JOGO, NÃO SEJA ENTERRADA!",playerName, 300, 175, 200, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement