Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. texto = "Olá , Sejam-Bem vindos a o novo minegame Emoções, nele é uma GUERRA de emoções .. Para participar dessa guerra aperta os números a cima e fassa emoções sairam objetos misteriósos .. Mais lembre-se tome cuidado isso é uma Guerra !!!! Participaçao/ Ajudante = Sexfemm, Xxarizardx"
  2.  
  3. function eventChatCommand(name, cmd)
  4. if cmd=='help' then
  5. ui.addTextArea(0, texto, name, 300, 100, 300, 200, 0x050505, 0x2ECF73, 0.8, true)
  6. ui.addTextArea(1, "<font size='20' color='#FF0019'><a href='event:close'>Fechar</a>", name, 415, 270, 100, 30, 0x050505, 0x2ECF73, 10, true)
  7. end
  8. end
  9.  
  10. function eventTextAreaCallback(id, name, callback)
  11. if callback == "close" then
  12. for id=0,10 do
  13. ui.removeTextArea(id, name)
  14. end
  15. end
  16. end
  17. tfm.exec.disableAutoNewGame(true)
  18. tfm.exec.disableAutoShaman(true)
  19. players={}
  20. toDespawn={}
  21.  
  22. function eventNewPlayer(name)
  23. for i,key in ipairs({48,49,50,51,52,53,54,55,56,57}) do
  24. tfm.exec.bindKeyboard(name,key,true,true)
  25. end
  26. players[name]={
  27. timestamp=os.time(),
  28. offsets={x=2, y=10}
  29. }
  30. end
  31.  
  32. function eventKeyboard(name,key,down,x,y)
  33. if (key == 48) and not tfm.get.room.playerList[name].isDead and started then
  34. if players[name].timestamp < os.time()-500 then
  35. local id=tfm.exec.addShamanObject(103, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  36. players[name].timestamp=os.time()
  37. table.insert(toDespawn,{os.time(),id})
  38. end
  39. end
  40.  
  41. if (key == 49) and not tfm.get.room.playerList[name].isDead and started then
  42. if players[name].timestamp < os.time()-500 then
  43. local id=tfm.exec.addShamanObject(403, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  44. players[name].timestamp=os.time()
  45. table.insert(toDespawn,{os.time(),id})
  46. end
  47. end
  48.  
  49. if (key == 50) and not tfm.get.room.playerList[name].isDead and started then
  50. if players[name].timestamp < os.time()-500 then
  51. local id=tfm.exec.addShamanObject(206, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  52. players[name].timestamp=os.time()
  53. table.insert(toDespawn,{os.time(),id})
  54. end
  55. end
  56.  
  57. if (key == 51) and not tfm.get.room.playerList[name].isDead and started then
  58. if players[name].timestamp < os.time()-500 then
  59. local id=tfm.exec.addShamanObject(1003, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  60. players[name].timestamp=os.time()
  61. table.insert(toDespawn,{os.time(),id})
  62. end
  63. end
  64.  
  65. if (key == 52) and not tfm.get.room.playerList[name].isDead and started then
  66. if players[name].timestamp < os.time()-500 then
  67. local id=tfm.exec.addShamanObject(6, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  68. players[name].timestamp=os.time()
  69. table.insert(toDespawn,{os.time(),id})
  70. end
  71. end
  72.  
  73. if (key == 53) and not tfm.get.room.playerList[name].isDead and started then
  74. if players[name].timestamp < os.time()-500 then
  75. local id=tfm.exec.addShamanObject(2810, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  76. players[name].timestamp=os.time()
  77. table.insert(toDespawn,{os.time(),id})
  78. end
  79. end
  80.  
  81. if (key == 54) and not tfm.get.room.playerList[name].isDead and started then
  82. if players[name].timestamp < os.time()-500 then
  83. local id=tfm.exec.addShamanObject(57, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 100 or -100)
  84. players[name].timestamp=os.time()
  85. table.insert(toDespawn,{os.time(),id})
  86. end
  87. end
  88.  
  89. if (key == 55) and not tfm.get.room.playerList[name].isDead and started then
  90. if players[name].timestamp < os.time()-500 then
  91. local id=tfm.exec.addShamanObject(59, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  92. players[name].timestamp=os.time()
  93. table.insert(toDespawn,{os.time(),id})
  94. end
  95. end
  96.  
  97. if (key == 56) and not tfm.get.room.playerList[name].isDead and started then
  98. if players[name].timestamp < os.time()-500 then
  99. local id=tfm.exec.addShamanObject(39, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  100. players[name].timestamp=os.time()
  101. table.insert(toDespawn,{os.time(),id})
  102. end
  103. end
  104. if (key == 57) and not tfm.get.room.playerList[name].isDead and started then
  105. if players[name].timestamp < os.time()-500 then
  106. local id=tfm.exec.addShamanObject(46, x+(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, 0, tfm.get.room.playerList[name].isFacingRight and 20 or -20)
  107. players[name].timestamp=os.time()
  108. table.insert(toDespawn,{os.time(),id})
  109. end
  110. end
  111. end
  112.  
  113. function eventChatCommand(name,command)
  114. local arg={}
  115. for argument in command:gmatch("[^%s]+") do
  116. table.insert(arg,argument)
  117. end
  118. if arg[1]=="off" then
  119. if tonumber(arg[2]) and tonumber(arg[3]) then
  120. players[name].offsets.x=tonumber(arg[2])
  121. players[name].offsets.y=tonumber(arg[3])
  122. else
  123. players[name].offsets.x=2
  124. players[name].offsets.y=10
  125. end
  126. tfm.exec.chatMessage("Offsets changed to X:"..players[name].offsets.x.." Y:"..players[name].offsets.y,name)
  127. end
  128. end
  129.  
  130. function eventNewGame()
  131. started=false
  132. end
  133.  
  134. function eventLoop(time,remaining)
  135. if time >= 1000 and not started then
  136. started=true
  137. end
  138. for i,cannon in ipairs(toDespawn) do
  139. if cannon[1] <= os.time()-3000 then
  140. tfm.exec.removeObject(cannon[2])
  141. table.remove(toDespawn,i)
  142. end
  143. end
  144. end
  145.  
  146. for name,player in pairs(tfm.get.room.playerList) do
  147. eventNewPlayer(name)
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement