Advertisement
Guest User

FullBall 1.6.1

a guest
Jul 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.62 KB | None | 0 0
  1. --[[ Disable ]]--
  2.  
  3. for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoScore'} do
  4. tfm.exec['disable' .. v]()
  5. end
  6. tfm.exec.chatMessage = print
  7. --[[ Something ]]--
  8. newData = {}
  9. tempo = os.time()
  10. maps = {7472840,7472843,7472870,7472872,7472873,7472895}
  11. p = {}
  12. vivo = 0
  13. deleteObjects = {}
  14. --[[ bootoons ]]--
  15. ui.addTextArea(201, "<p align='center'><a href='event:profile'><B>P</B></a></p>", name, 9, 27, 29, 19, 0x313a4a, 0x313a4a, 1, true)
  16. ui.addTextArea(202, "<p align='center'><a href='event:shop'><B>S</B></a></p>", name, 51, 27, 29, 19, 0x313a4a, 0x313a4a, 1, true)
  17. ui.addTextArea(203, "<p align='center'><a href='event:help'><B>H</B></a></p>", name, 94, 27, 29, 19, 0x313a4a, 0x313a4a, 1, true)
  18.  
  19. --[[ Translation ]]--
  20. translations = {
  21. br = {
  22. msg_welcome = "<VP>[•] Bem-vindo ao FullBall, sua missão aqui é encher a sala com bolas para que você seja o primeiro a chegar ao queijo. Você pode?",
  23. msg_upLevel = "Uau, você subiu um nível!",
  24. msg_beachball = "Praia",
  25. msg_pokeball = "PokeBola",
  26. msg_skullball = "crânio",
  27. msg_soon = "Em breve!!",
  28. msg_noCoins = "Você não tem moedas suficientes :(",
  29. msg_buyed = "Obrigado! Você está com um novo equipamento.",
  30. msg_playerWon = " Parabéns! Você adquiriu +10 XP e +5 moedas",
  31. msg_help = "<ROSE>Encha a sala com o máximo de bolas que você puder.\n• Level 0-20 Bola de praia\n• Level 21-30 Pokeball\n• Level +30 Bola de crânio",
  32. },
  33. en = {
  34. msg_welcome = "<VP>[•] Welcome to FullBall, your mission here is to fill the room with balls so that you can be the first to arrive at the cheese. You can?",
  35. msg_upLevel = "Wow, you went up one level!",
  36. msg_beachball = "Beach Ball",
  37. msg_pokeball = "Pokeball",
  38. msg_skullball = "Skullball",
  39. msg_soon = "COMING SOON",
  40. msg_noCoins = "You don't have enough coins :(",
  41. msg_buyed = "Thanks! You've the new booster.",
  42. msg_playerWon = "Hey! You have acquired +10 XP and +5 coins",
  43. msg_help = "<ROSE>Fill the room with as many balls as you can.\n• Level 0-20 Beach Ball\n• Level 21-30 Pokeball\n• Level +30 Skull Ball",
  44. }
  45. }
  46. --[[ Script data ]]--
  47. function eventNewPlayer(name)
  48. newData[name] = {
  49. Xp = 0,
  50. Team = "",
  51. XpLevel = 0,
  52. Level = 0,
  53. Life = 3,
  54. lang = "",
  55. ballLevel = 6,
  56. Coins = 50,
  57. ballName = "",
  58. tempo = os.time()
  59. }
  60. ui.setMapName("FullBall")
  61. newData[name].lang = translations[tfm.get.room.playerList[name].community] and tfm.get.room.playerList[name].community or 'en'
  62. --[[ new round ]]--
  63. function novaRodada()
  64. tfm.exec.newGame(maps[math.random(#maps)])
  65. end
  66. --[[ envent die]]--
  67. function eventPlayerDied(name)
  68. vivo = vivo -1
  69. end
  70. --[[ event Loop ]]--
  71. function eventLoop(currentTime,timeRemaining)
  72. for _,obj in ipairs(deleteObjects) do
  73. if obj.time < os.time()-15000 then
  74. tfm.exec.removeObject(obj.id)
  75. table.remove(deleteObjects,_)
  76. end
  77. end
  78. if vivo == 0 or timeRemaining <= 0 then -- Verifica se A Variavel vivo Chegou a 0 Ou Se o Tempo Restante Do Mapa Chegou a 0
  79. novaRodada();
  80. end
  81. end
  82. --[[ new game ]]--
  83. function eventNewGame()
  84. vivo=0; -- A Variavel vivo Reseta
  85. for p in pairs(tfm.get.room.playerList) do -- Pra Todos Os Jogadores Da Sala
  86. vivo=vivo+1; -- Soma Da Variavel vivo
  87. end
  88. MoreLevel(name)
  89. tfm.exec.setGameTime(210)
  90. end
  91. --[[ new player ]]--
  92. function eventNewPlayer(name) -- The event happens when a player enters the room
  93. tfm.exec.chatMessage(""..translations[newData[name].lang].msg_welcome.."",name)
  94. end
  95. --[[ Play Won ]]--
  96. function eventPlayerWon(name) -- The event happens when a player enters the hole.
  97. newData[name].Xp = newData[name].Xp + 10
  98. newData[name].Coins = newData[name].Coins + 5
  99. MoreLevel(name)
  100. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_playerWon.."",name)
  101. end
  102. --[[ Play LEVEL more one]]--
  103. function MoreLevel(name)
  104. if newData[name].Xp == 100 then
  105. newData[name].Xp = 0
  106. newData[name].Level = newData[name].Level + 1
  107. tfm.exec.chatMessage(""..translations[newData[name].lang].msg_upLevel.."",name)
  108. end
  109. end
  110. --[[ ball ]]--
  111. if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  112. info[p].time = os.time()
  113. tfm.exec.movePlayer(p,0,0,true,100,0,false)
  114. elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  115. info[p].time = os.time()
  116. tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  117. end
  118. local facingLeft = {}
  119.  
  120. for name in pairs(tfm.get.room.playerList) do
  121. for _,key in pairs{0,2,3} do system.bindKeyboard(name, key, true)
  122. end
  123. end
  124.  
  125. function eventKeyboard(name, key, down, x, y)
  126. if os.time()-10000 then
  127. if key == 0 or key == 2 then
  128. facingLeft[name] = key == 0
  129. elseif key == 32 then
  130. if facingLeft[name] then
  131. obj_id = tfm.exec.addShamanObject(newData[name].ballLevel, x - 8, y - 5, 0, 20)
  132. else
  133. obj_id = tfm.exec.addShamanObject(newData[name].ballLevel, x + 8, y - 5, 0, 20)
  134. end
  135. table.insert(deleteObjects,{id=obj_id,time=os.time()})
  136. end
  137. end
  138. end
  139. --[[ TXT AREA ]]--
  140. function eventTextAreaCallback(t,p,link)
  141. if link == [[profile]] then
  142. ui.addTextArea(10, "", p, 266, 116, 267, 168, 0x313a4a, 0x313a4a, 1, true)
  143. ui.addTextArea(11, "<font size='20'><b>XP</font>", p, 266, 117, 79, 26, 0x324650, 0x000000, 0, true)
  144. ui.addTextArea(12, "<font size='14'><b>"..newData[p].Xp.."/100<font>", p, 268, 148, 86, 24, 0x314a4a, 0x313a4a, 1, true)
  145. ui.addTextArea(13, "<font size='20'><b>Level</font>", p, 364, 117, 79, 26, 0x324650, 0x000000, 0, true)
  146. ui.addTextArea(14, "<font size='14'><b>"..newData[p].Level.."<font>", p, 367, 148, 86, 24, 0x314a4a, 0x313a4a, 1, true)
  147. ui.addTextArea(15, "<font size='20'><b>Ball</font>", p, 269, 185, 79, 26, 0x324650, 0x000000, 0, true)
  148. ui.addTextArea(16, "<font size='14'><b>"..newData[p].ballName.."<font>", p, 268, 216, 86, 24, 0x314a4a, 0x313a4a, 1, true)
  149. ui.addTextArea(17, "<font size='15'><a href='event:closeprofile'><b><R>X</R></a>", p, 512, 117, 21, 27, 0x324650, 0x000000, 0, true)
  150. elseif link == [[closeprofile]] then
  151. for i = 10,17 do --
  152. ui.removeTextArea(i,p)
  153. end
  154. elseif link == [[shop]] then
  155. ui.addTextArea(50, "<font size='20'></font>", p, 244, 113, 311, 173, 0x313a4a, 0x313a4a, 1, true)
  156. ui.addTextArea(51, "<font size='15'><a href='event:closeshop'><b><R>X</R></a>", p, 532, 115, 21, 27, 0x324650, 0x000000, 0, true)
  157. ui.addTextArea(52, "<font size='20'><p align='center'>Boxes</p></font>\n<p align='center'><B>steampunk</p>\n", p, 257, 136, 77, 84, 0x314a4a, 0x313a4a, 1, true)
  158. ui.addTextArea(53, "<a href='event:buy1'><B>50 Coins</a>", p, 257, 233, 77, 16, 0x314a4a, 0x313a4a, 1, true)
  159. ui.addTextArea(54, "<font size='18'><p align='center'>Chicken</p><font>", p, 349, 136, 77, 84, 0x314a4a, 0x313a4a, 1, true)
  160. ui.addTextArea(55, "<a href='event:buy2'><B>75 Coins</a>", p, 349, 233, 77, 16, 0x314a4a, 0x313a4a, 1, true)
  161. ui.addTextArea(56, "<font size='20'><p align='center'>Bomb</p><font>", p, 442, 136, 77, 84, 0x314a4a, 0x313a4a, 1, true)
  162. ui.addTextArea(57, "<a href='event:buy3'><B>100 Coins</a>", p, 442, 233, 77, 16, 0x314a4a, 0x313a4a, 1, true)
  163. elseif link == [[closeshop]] then
  164. for i = 50,57 do --
  165. ui.removeTextArea(i,p)
  166. end
  167. elseif link == [[buy1]] then
  168. if newData[name].Coins >= 50 then
  169. newData[name].Coins = newData[name].Coins - 50
  170. newData[name].ballLevel = 202
  171. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_buyed.."",p)
  172. else
  173. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_noCoins.."",p)
  174. end
  175. elseif link == [[buy2]] then
  176. if newData[name].Coins >= 75 then
  177. newData[name].Coins = newData[name].Coins - 75
  178. newData[name].ballLevel = 33
  179. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_buyed.."",p)
  180. else
  181. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_noCoins.."",p)
  182. end
  183. elseif link == [[buy3]] then
  184. if newData[name].Coins >= 100 then
  185. newData[name].Coins = newData[name].Coins - 100
  186. newData[name].ballLevel = 3
  187. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_buyed.."",p)
  188. else
  189. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_noCoins.."",p)
  190. end
  191. elseif link == [[help]] then
  192. tfm.exec.chatMessage(""..translations[newData[p].lang].msg_help.."",p)
  193. end
  194. end
  195. end -- end eventnewplayer
  196. table.foreach(tfm.get.room.playerList,eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement