Advertisement
Guest User

FullBall 1.6

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