Advertisement
superpaste

deus tfm

Apr 8th, 2017
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.00 KB | None | 0 0
  1. --se quiseres podes mudar o admin, caso é nil, pode ser selecionado usando !nickname
  2.  
  3. admin = ""
  4. tfm.exec.disableAutoShaman(true)
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAutoTimeLeft(true)
  7. objectid = 17
  8. power = 50
  9. admined = false
  10. moving = false
  11. if admin == "" then
  12. ui.addTextArea(1, "comando ! para selecionar admin (primeira letra é maiúscula)", nil, 300, 20, 0, 0, 0x324650, 0x324650, 1, true)
  13. else
  14. admined = true
  15. system.bindMouse(admin, true)
  16. ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
  17.  
  18. end
  19. for i, v in pairs(tfm.get.room.playerList) do
  20. system.disableChatCommandDisplay("set " .. i, true)
  21. end
  22.  
  23. function eventNewPlayer(j)
  24. system.disableChatCommandDisplay("set " .. j, true)
  25. end
  26. function eventLoop()
  27. if admined then
  28. tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 5, 0, 0, 0, nil)
  29. tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, -5, 0, 0, 0, nil)
  30. tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 0, 5, 0, 0, nil)
  31. tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 0, -5, 0, 0, nil)
  32.  
  33. end
  34.  
  35. end
  36.  
  37. function eventChatCommand(jogador, comando)
  38.  
  39. if admined == true then
  40.  
  41. if jogador == admin then
  42. if string.sub(comando, 1, 3) == "set" then
  43. subject = string.sub(comando, 5)
  44. ui.addTextArea(1, "", jogador, 0, 20, 500, 320, 0xCFCFCF, 0x324650, 1, true)
  45. ui.addTextArea(2, "<a href='event:queijo'>Dar queijo</a>", jogador, 0, 20, 500, 0, 0x324650, 0x324650, 1, true)
  46. ui.addTextArea(3, "<a href='event:meep'>Dar meep</a>", jogador, 0, 50, 500, 0, 0x324650, 0x324650, 1, true)
  47. ui.addTextArea(4, "<a href='event:kill'>Morte</a>", jogador, 0, 80, 500, 0, 0x324650, 0x324650, 1, true)
  48. ui.addTextArea(5, "<a href='event:move'>mexer com ele</a>", jogador, 0, 110, 500, 0, 0x324650, 0x324650, 1, true)
  49. ui.addTextArea(6, "<a href='event:respawn'>renascer ele</a>", jogador, 0, 140, 500, 0, 0x324650, 0x324650, 1, true)
  50. ui.addTextArea(7, "<a href='event:change color'>mudar a cor do nick</a>", jogador, 0, 170, 500, 0, 0x324650, 0x324650, 1, true)
  51. ui.addTextArea(8, "<a href='event:score'>muda o score</a>", jogador, 0, 200, 500, 0, 0x324650, 0x324650, 1, true)
  52. ui.addTextArea(9, "<a href='event:shaman'>colocar shaman (permamente!)</a>", jogador, 0, 230, 500, 0, 0x324650, 0x324650, 1, true)
  53. ui.addTextArea(10, "<a href='event:vamp'>colocar como vampiro (meep desaparecerá)</a>", jogador, 0, 260, 500, 0, 0x324650, 0x324650, 1, true)
  54. ui.addTextArea(11, "<a href='event:close'>fechar</a>", jogador, 0, 350, 500, 0, 0x324650, 0x324650, 1, true)
  55. ui.addTextArea(12, "<a href='event:fly'>dar fly</a>", jogador, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
  56.  
  57. ui.addTextArea(13, "<a href='event:ffa'>Dar FFA</a>", jogador, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
  58. ui.addTextArea(14, "para " .. subject, jogador, 0, 380, 00, 0, 0x324650, 0x324650, 1, true)
  59.  
  60. end
  61. end
  62. else
  63. admin = comando
  64. admined = true
  65. print(comando .. " subiu a admin, pedido por " .. jogador)
  66. ui.removeTextArea(1, nil)
  67. system.bindMouse(admin, true)
  68. ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
  69.  
  70. end
  71. end
  72.  
  73. function eventTextAreaCallback(id, player, callback)
  74. if callback == "queijo" then
  75. tfm.exec.giveCheese(subject)
  76. end
  77. if callback == "meep" then
  78. tfm.exec.giveMeep(subject)
  79. end
  80. if callback == "kill" then
  81. tfm.exec.killPlayer(subject)
  82. end
  83. if callback == "move" then
  84. moving = true
  85. end
  86. if callback == "respawn" then
  87. tfm.exec.respawnPlayer(subject)
  88. end
  89. if callback == "change color" then
  90. ui.showColorPicker(1, admin, 0, "muda de cor")
  91. end
  92. if callback == "score" then
  93. ui.addPopup(1, 2, "quanto de score deve ser adicionado?", admin, 200, 200,300, true)
  94. end
  95. if callback == "shaman" then
  96. tfm.exec.setShaman(subject)
  97. end
  98. if callback == "vamp" then
  99. tfm.exec.setVampirePlayer(subject)
  100. end
  101. if callback == "change" then
  102. ui.addPopup(3, 2, "Mapa (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
  103.  
  104. end
  105. if callback =="time" then
  106. ui.addPopup(4, 2, "tempo (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
  107.  
  108. end
  109. if callback == "snow" then
  110. ui.addPopup(5, 2, "quanto tempo (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
  111.  
  112. end
  113. if callback == "setname" then
  114. ui.addPopup(6, 2, "nome do mapa", admin, 200, 200,300, true)
  115.  
  116. end
  117. if callback == "ffa" then
  118. system.bindKeyboard(subject, 77, false, true)
  119. ui.removeTextArea(13, nil)
  120. ui.addTextArea(13, "<a href='event:dffa'>Tirar FFA</a>", admin, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
  121.  
  122. end
  123. if callback == "dffa" then
  124. system.bindKeyboard(subject, 77, false, false)
  125. ui.removeTextArea(13, nil)
  126. ui.addTextArea(13, "<a href='event:ffa'>Dar FFA</a>", admin, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
  127. end
  128. if callback == "setobject" then
  129. ui.addPopup(7, 2, "Id do objeto a ser atirado", admin, 200, 200,300, true)
  130.  
  131. end
  132. if callback == "setvel" then
  133. ui.addPopup(8, 2, "Velocidade a ser atirada", admin, 200, 200,300, true)
  134.  
  135. end
  136. if callback == "ambient" then
  137. ui.addTextArea(1, "", player, 0, 20, 500, 300, 0xCFCFCF, 0x324650, 1, true)
  138. ui.addTextArea(2, "<a href='event:change'>mudar o mapa</a>", player, 0, 20, 500, 0, 0x324650, 0x324650, 1, true)
  139. ui.addTextArea(3, "<a href='event:time'>mudar o tempo do mapa</a>", player, 0, 50, 500, 0, 0x324650, 0x324650, 1, true)
  140. ui.addTextArea(4, "<a href='event:snow'>fazer nevar</a>", player, 0, 80, 500, 0, 0x324650, 0x324650, 1, true)
  141. ui.addTextArea(5, "<a href='event:setname'>mudar o nome do mapa</a>", player, 0, 110, 500, 0, 0x324650, 0x324650, 1, true)
  142. ui.addTextArea(6, "<a href='event:setobject'>Mudar o objeto atirado, em caso de FFA</a>", player, 0, 140, 500, 0, 0x324650, 0x324650, 1, true)
  143. ui.addTextArea(7, "<a href='event:setvel'>Mudar o poder do objeto, em caso de FFA</a>", player, 0, 170, 500, 0, 0x324650, 0x324650, 1, true)
  144. ui.addTextArea(11, "<a href='event:close'>fechar</a>", player, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
  145. end
  146. if callback == "close" then
  147. for i=1,14 do
  148. ui.removeTextArea(i, admin)
  149. end
  150. ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
  151. end
  152. if callback == "dfly" then
  153. system.bindKeyboard(subject, 32, false, false)
  154. ui.removeTextArea(12, nil)
  155. ui.addTextArea(12, "<a href='event:fly'>dar fly</a>", admin, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
  156. end
  157. if callback == "fly" then
  158. system.bindKeyboard(subject, 32, false, true)
  159. ui.removeTextArea(12, nil)
  160. ui.addTextArea(12, "<a href='event:dfly'>tirar fly</a>", admin, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
  161. end
  162. end
  163. function eventColorPicked(id, nill, cor)
  164. if cor == -1 then
  165. else
  166. tfm.exec.setNameColor(subject, cor)
  167. end
  168. end
  169. function eventPopupAnswer(id, jogador, resposta)
  170. if id == 1 then
  171. answer = resposta
  172. ui.addPopup(2, 1, "alterar (ou adicionar)?", admin, 200, 200, 300, true)
  173. end
  174. if id == 2 then
  175. tfm.exec.setPlayerScore(subject, answer, resposta)
  176. end
  177. if id == 3 then
  178. tfm.exec.newGame(resposta, nil)
  179. end
  180. if id == 4 then
  181. tfm.exec.setGameTime(resposta, true)
  182. end
  183. if id == 5 then
  184. tfm.exec.snow(resposta, 10)
  185. end
  186. if id == 6 then
  187. ui.setMapName(resposta)
  188. end
  189. if id == 7 then
  190. objectid = resposta
  191. end
  192. if id == 8 then
  193. power = resposta
  194. end
  195. end
  196. function eventMouse(j, x, y)
  197. if moving then
  198. tfm.exec.movePlayer(subject, x, y, false, 0, 0, true)
  199. moving = false
  200. end
  201. end
  202.  
  203. function eventKeyboard(j, id, p, x, y)
  204. if id == 32 then
  205. tfm.exec.movePlayer(j, 0, 0, true, 0, -50, true)
  206. end
  207. if id == 77 then
  208. if tfm.get.room.playerList[j].isFacingRight then
  209. tfm.exec.addShamanObject(objectid,x+20,y-10,90,power,0)
  210. else
  211. tfm.exec.addShamanObject(objectid,x-20,y-10,-90,-power,0)
  212. end
  213. end
  214. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement