Advertisement
KananGamer

[TFM-LUA] Script de um amigo

Jan 8th, 2021 (edited)
1,763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. local totalBalls = 0
  2.  
  3. function nextMap()
  4.     tfm.exec.newGame(7805070)
  5. end
  6.  
  7. function spawnBall()
  8.     totalBalls = totalBalls + 1
  9.  
  10.     tfm.exec.addPhysicObject(totalBalls, 1500, 30, {
  11.         type = 13,
  12.         color = math.random(0x01),
  13.         width = 10,
  14.         height = 10,
  15.         friction = .3,
  16.         restitution = .3,
  17.         miceCollision = true,
  18.         groundCollision = true,
  19.         dynamic = true,
  20.         mass = .5,
  21.     })
  22. end
  23.  
  24. function eventTextAreaCallback(id, player, event)
  25.     if event == "ajd" then
  26.         ui.addTextArea(2000, "<p align='center'><a href='event:ventajd'>#Vent                                                                Sobreviva e chegue ao queijo enquato bolas te derrubam do mapa!                                                                        Por Sklag#2552</a></p>", player, 6, 75, 200, 100, 0x1, 0x1, 1, true)
  27.         ui.addTextArea(1000, "<p align='center'><a href='event:fechar'>Fechar</a></p>", player, 6, 175, 200, 25, 0x1, 0x1, 1, true)
  28.     elseif event == "fechar" then
  29.         ui.removeTextArea(2000, player)
  30.         ui.removeTextArea(1000, player)
  31.     end
  32. end
  33.  
  34. function eventLoop(sinceStart)
  35.     if sinceStart >= 3000 then
  36.         spawnBall()
  37.     end
  38. end
  39.  
  40. function eventNewGame()
  41.     totalBalls = 0
  42.  
  43.     nextMap()
  44. end
  45.  
  46. function eventNewPlayer(player)
  47.     ui.addTextArea(20000, "<p align='center'><a href='event:ajd'>Ajuda</a></p>", player, 6, 25, nil, nil, 0x1, 0x1, 1, true)
  48. end
  49.  
  50. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  51.  
  52. for index, value in next, {'AutoShaman', 'PhysicalConsumables'} do
  53.     tfm.exec['disable' .. value]()
  54. end
  55.  
  56. nextMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement