Boeing747-8

Untitled

Dec 17th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.46 KB | None | 0 0
  1. tfm.exec.disableAfkDeath(true)
  2. tfm.exec.disableAutoShaman(true)
  3.  
  4.  
  5.  
  6.  
  7. tfm.exec.disableAutoNewGame(true)
  8. maps={6946086,6354056,6373101,6947670}
  9.  
  10. function eventLoop(time,remaining)
  11. if remaining<=0 then
  12. tfm.exec.newGame(maps[math.random(#maps)])
  13. end
  14. end
  15.  
  16. function eventPlayerDied()
  17. local i=0
  18. for n,player in pairs(tfm.get.room.playerList) do
  19. if not player.isDead then
  20. i=i+1
  21. tfm.exec.respawnPlayer(n)
  22. end
  23. end
  24. if i==0 then
  25. tfm.exec.newGame(maps[math.random(#maps)])
  26. end
  27. end
  28.  
  29. function eventPlayerWon(name)
  30. tfm.exec.respawnPlayer(name)
  31. tfm.exec.chatMessage("<VP>You just completed the level!",name)
  32. tfm.exec.chatMessage("<VP>Your score: "..tfm.get.room.playerList[name].score,name)
  33. end
  34.  
  35. DOWN3 = string.byte("O")
  36. DOWN4 = 38
  37. DOWN1 = 40 --keycode of down arrow
  38. DOWN2 = string.byte("S") --keycode of S
  39.  
  40. for name, player in pairs(tfm.get.room.playerList) do
  41. system.bindKeyboard(name, DOWN1, true)
  42. system.bindKeyboard(name, DOWN2, true)
  43. system.bindKeyboard(name, DOWN4, true)
  44. system.bindKeyboard(name, DOWN3, true)
  45. end
  46.  
  47. function eventKeyboard(name, keyCode, down, x, y)
  48. if keyCode == DOWN1 or keyCode == DOWN2 then
  49. tfm.exec.explosion(x, y + 20, 10, 60, true) -- spark(?) explosion
  50. tfm.exec.displayParticle(tfm.enum.particle.spirit, x, y + 30) -- spark(?) spirit particle
  51. elseif keyCode == DOWN3 or keyCode == DOWN4 then
  52. tfm.exec.explosion(x, y - 20, 10, 60, true) -- spark(?) explosion
  53. tfm.exec.displayParticle(tfm.enum.particle.spirit, x, y - 30) -- spark(?) spirit particle
  54. end
  55. end
  56.  
  57. for name,player in pairs(tfm.get.room.playerList) do
  58. system.bindMouse(name)
  59. end
  60.  
  61. function pythag(x1,y1,x2,y2)
  62. return math.sqrt((y2-y1)^2+(x2-x1)^2)
  63. end
  64.  
  65. function eventMouse(n,x,y)
  66. for n,p in pairs(tfm.get.room.playerList) do
  67. if pythag(x,y,p.x,p.y) <= 15 then
  68. tfm.exec.movePlayer(n,100,100,true,0,50,false)
  69. tfm.exec.addShamanObject(27,x,tfm.get.room.playerList,45,50,-20,false)
  70. end
  71. end
  72. end
  73.  
  74. ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",nil,5,175,70,20,0x000001,0x000001,1,true)
  75. ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",nil,5,195,70,20,0x000001,0x000001,1,true)
  76. ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",nil,5,215,70,20,0x000001,0x000001,1,true)
  77. ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",nil,5,235,70,20,0x000001,0x000001,1,true)
  78. ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",nil,5,155,70,20,0x000001,0x000001,1,true)
  79. function eventTextAreaCallback(textAreaID, playerName, callback)
  80. if callback=="example" then
  81. tfm.exec.setVampirePlayer(playerName)
  82. elseif callback=="999" then
  83. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  84. ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,235,70,20,0x000001,0x000001,1,true)
  85. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Commands <a align='center'><font size='20' color='#0000FF'><p'> <J>!maps - Shows the maps that are in the rotation of #Zerogravity. <V>",playerName,180,100,500,200,0x272727,0x000001,1,true)
  86. elseif callback=="44" then
  87. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  88. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Credits <a align='center'><font size='20' color='#0000FF'><p'> <J>Fuzzyfirsdog - Coding the minigame. <V>Tohpy - Working on BR translate. <VI> Bibsho - Gave ideas for the minigame. <T>Tortuegreen - Showed Fuzzyfirsdog how to use some coding stuff. <CH> Suprodo - Gave ideas for the minigame.",playerName,180,100,500,260,0x272727,0x000001,1,true)
  89. ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,215,70,20,0x000001,0x000001,1,true)
  90. elseif callback=="p0" then
  91. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  92. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
  93. ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,70,20,0x000001,0x000001,1,true)
  94. ui.addTextArea(5,"<a href='event:5' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,195,70,20,0x000001,0x000001,1,true)
  95. elseif callback=="59" then
  96. ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",playerName,730,175,70,20,0x000001,0x000001,1,true)
  97. ui.addTextArea(2,"<a href='event:p0' align='center'><font size='11' color='#00FF57'><p'>Help</a>",playerName,730,195,70,20,0x000001,0x000001,1,true)
  98. ui.addTextArea(4,"<a href='event:44' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",playerName,730,215,70,20,0x000001,0x000001,1,true)
  99. ui.addTextArea(30,"<a href='event:999' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",playerName,730,235,70,20,0x000001,0x000001,1,true)
  100. ui.addTextArea(31,"<a href='event:69' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,730,155,70,20,0x000001,0x000001,1,true)
  101. elseif callback=="69" then
  102. ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",playerName,5,175,70,20,0x000001,0x000001,1,true)
  103. ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",playerName,5,195,70,20,0x000001,0x000001,1,true)
  104. ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",playerName,5,215,70,20,0x000001,0x000001,1,true)
  105. ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",playerName,5,235,70,20,0x000001,0x000001,1,true)
  106. ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,5,155,70,20,0x000001,0x000001,1,true)
  107.  
  108. elseif callback=="99" then
  109. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  110. ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,235,70,20,0x000001,0x000001,1,true)
  111. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Commands <a align='center'><font size='20' color='#0000FF'><p'> <J>!maps - Shows the maps that are in the rotation of #Zerogravity. !help - Gives you some of the help and then gives you a larger Help button to draw your attention.<V>",playerName,180,100,500,200,0x272727,0x000001,1,true)
  112. elseif callback=="4" then
  113. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  114. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Credits <a align='center'><font size='20' color='#0000FF'><p'> <J>Fuzzyfirsdog - Coding the minigame. <V>Tohpy - Working on BR translate. <VI> Bibsho - Gave ideas for the minigame. <T>Tortuegreen - Showed Fuzzyfirsdog how to use some coding stuff. <CH> Suprodo - Gave ideas for the minigame. <BV>Pinyxzyaj- Makes sure that there are no bugs in the game.",playerName,180,100,500,260,0x272727,0x000001,1,true)
  115. ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,215,70,20,0x000001,0x000001,1,true)
  116. elseif callback=="p" then
  117. ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
  118. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
  119. ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,70,20,0x000001,0x000001,1,true)
  120. ui.addTextArea(5,"<a href='event:5' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,195,70,20,0x000001,0x000001,1,true)
  121. elseif callback=="9" then
  122. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> There are some things that you have the ability to do, for example, you can duck to spawn a spirit. You can also click Vampire to become a Vampire. Clicking O spawns a spark on top of you, rather than under you.",playerName,180,100,500,190,0x272727,0x000001,1,true)
  123. ui.addTextArea(9,"<a href='event:88' align='center'><font size='11' color='#00FF57'><p'>Back</a>",playerName,300,265,60,20,0x000001,0x000001,1,true)
  124. elseif callback=="88" then
  125. ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
  126. ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,60,20,0x000001,0x000001,1,true)
  127. elseif callback=="5" or callback=="7" then
  128. ui.removeTextArea(5,playerName)
  129. ui.removeTextArea(3,playerName)
  130.  
  131. ui.removeTextArea(200,playerName)
  132. ui.removeTextArea(7,playerName)
  133. ui.removeTextArea(9,playerName)
  134. ui.removeTextArea(1000,playerName)
  135. end
  136. end
  137.  
  138.  
  139.  
  140. function eventNewGame()
  141. o=tfm.get.room.xmlMapInfo.mapCode
  142. a=tfm.get.room.xmlMapInfo.author
  143. m=tfm.get.room.currentMap.id
  144. tfm.exec.setUIMapName("<VP>@"..o.." - Creator: "..a)
  145. if m=="6946086" then
  146. tfm.exec.setUIMapName("<VP>@"..o.." - Level 1 - Creator: "..a)
  147. end
  148. end
  149.  
  150. tfm.exec.chatMessage("<ROSE>")
  151.  
  152. function eventPlayerDied(name)
  153. tfm.exec.respawnPlayer(name)
  154. end
  155.  
  156. system.disableChatCommandDisplay("help",true)
  157. system.disableChatCommandDisplay("maps",true)
  158. system.disableChatCommandDisplay("x",true)
  159. function eventChatCommand(m,n)
  160. if n=="maps" then
  161. tfm.exec.chatMessage("["..#maps.." Maps]<J> MAPS: <VP>6946086, 6354056, 6373101, 6947670",m)
  162. elseif n=="help" then
  163. tfm.exec.chatMessage("<a align='center'><font size='12' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='12' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. Click the highlighted button to see more information.",m)
  164. ui.addTextArea(200,"<a href='event:p' align='center'><font size='130' color='#00FF57'><p'> Help</a>",m,250,-5,600,600,0x000001,0xFFE300,0,true)
  165. elseif n=="x" then
  166. ui.removeTextArea(200)
  167. end
  168. end
  169.  
  170.  
  171. function eventNewPlayer(n)
  172. tfm.exec.respawnPlayer(n)
  173. system.bindKeyboard(n, DOWN1, true)
  174. system.bindKeyboard(n, DOWN2, true)
  175. system.bindKeyboard(n, DOWN4, true)
  176. system.bindKeyboard(n, DOWN3, true)
  177. ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",n,5,175,70,20,0x000001,0x000001,1,true)
  178. ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",n,5,195,70,20,0x000001,0x000001,1,true)
  179. ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",n,5,215,70,20,0x000001,0x000001,1,true)
  180. ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,5,155,70,20,0x000001,0x000001,1,true)
  181. ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",nil,5,235,70,20,0x000001,0x000001,1,true)
  182. tfm.exec.setUIMapName("<VP>@"..o.." - Creator: "..a)
  183. end
  184.  
  185. tfm.exec.setGameTime(5)
  186. tfm.exec.setRoomMaxPlayers(10)
  187.  
  188. function eventNewGame()
  189. ui.removeTextArea (0) --Remove textarea when a new round begins
  190. ui.removeTextArea (992)
  191. mouseWon = false
  192. o=tfm.get.room.xmlMapInfo.mapCode
  193. a=tfm.get.room.xmlMapInfo.author
  194. m=tfm.get.room.currentMap.id
  195. tfm.exec.setUIMapName("<J>@"..o.."<VP> - Creator: "..a)
  196. if m=="6946086" then
  197. tfm.exec.setUIMapName("<VP>@"..o.." - Level 1 - Creator: "..a)
  198. tfm.exec.chatMessage("<ROSE>[MAP INFO] <CH>@"..o.."<> - Creator: <J>"..a,name)
  199. end
  200. end
  201.  
  202. function eventPlayerWon(name)
  203. if not mouseWon then --This'll trigger only when the first mouse gets in the hole
  204. ui.addTextArea (992,"<a align='center'><font size='95' color='#E9D504'><a'> ",nil,-400,-405,9000,9000,0x000001,0x000001,0.4,true)
  205. ui.addTextArea (0,"<a align='center'><font size='95' color='#E9D504'><a'> Bravo "..name.."! ",nil,105,85,790,1000,0x000001,0x000001,0,true)
  206. mouseWon = true
  207. tfm.exec.setGameTime(5)
  208. tfm.exec.chatMessage("<VP>You just completed the level!",name)
  209. tfm.exec.chatMessage("<VP>Your score: "..tfm.get.room.playerList[name].score,name)
  210. end
  211. end
  212.  
  213. tfm.exec.chatMessage("<a align='center'><font size='12' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='12' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. Click the highlighted button to see more information.")
Advertisement
Add Comment
Please, Sign In to add comment