Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.28 KB | None | 0 0
  1. local maps = {"7524569","7524554"}
  2. local game = {
  3. alive = 0,
  4. players = {},
  5. start = 5,
  6. finished = false,
  7. ending = 10
  8. }
  9.  
  10. function disable()
  11. tfm.exec.disableAfkDeath(true)
  12. tfm.exec.disableAutoNewGame(true)
  13. tfm.exec.disableAllShamanSkills(true)
  14. tfm.exec.disableAutoScore(true)
  15. tfm.exec.disableAutoTimeLeft(true)
  16. tfm.exec.disableAutoShaman(true)
  17. tfm.exec.disableMinimalistMode(true)
  18. tfm.exec.disableMortCommand(true)
  19. tfm.exec.disableWatchCommand(true)
  20. system.disableChatCommandDisplay('ayuda',true)
  21. end
  22.  
  23. function play(s)
  24. tfm.exec.newGame(s)
  25. tfm.exec.setGameTime(1)
  26. game.start = 5
  27. game.players = {}
  28. end
  29.  
  30. function survive()
  31. disable()
  32. game.alive = 0
  33. for name,player in pairs(tfm.get.room.playerList) do
  34. game.alive = game.alive + 1
  35. end
  36. play(maps[math.random(#maps)])
  37. tfm.exec.setUIMapName("#Crazy<bl>Cannons")
  38.  
  39. end
  40.  
  41. function won(name)
  42. game.finished = true
  43. tfm.exec.setGameTime(10)
  44. game.ending = 10
  45. if game.alive == 1 then
  46. for i=1,1,1 do
  47. tfm.exec.giveCheese(game.players[i])
  48. tfm.exec.playerVictory(game.players[i])
  49. end
  50. ui.addPopup(0,0,'<p align="center"><b>¡<font color="#009D9D">'..game.players[1]..'</font><font color=""> ha ganado el juego!</b></p>',nil,200,200,400,true)
  51. end
  52. end
  53.  
  54. function eventPlayerDied(name)
  55. game.alive=game.alive-1
  56. if game.alive > 0 then
  57. if game.alive<=2 then
  58. local i = 0
  59. for name,player in pairs(tfm.get.room.playerList) do
  60. if not player.isDead then
  61. i = i + 1
  62. table.insert(game.players,i,name)
  63. end
  64. end
  65. won(name)
  66. end
  67. end
  68. end
  69.  
  70. function eventLoop()
  71. if game.start == 0 then
  72. ui.setShamanName("¡Sobrevive!")
  73. for i=1,3 do
  74. tfm.exec.addShamanObject(17,math.random(800),math.random(-200,0),180)
  75. end
  76. else
  77. game.start = game.start - 0.5
  78. ui.setShamanName("El juego empezará en "..math.floor(game.start))
  79. end
  80. if game.finished == true then
  81. game.ending = game.ending - 0.5
  82. ui.setShamanName("El juego terminará en "..math.floor(game.ending))
  83. if game.ending == 0 then
  84. game.finished = false
  85. game.ending = 0
  86. survive()
  87. end
  88. end
  89. end
  90.  
  91. function eventChatCommand(name,cmd)
  92. if cmd == "ayuda" then
  93. ui.addPopup(1,0,"<b><font color='#BABD2F'>#Crazy</font><font color='#606090'>Cannons</font><b> fue creado por <font color='#009D9D'>Soyloquisha</font><font color='#6C77C1'>#0000</font>.<br><p align='center'>_____</p><p align='center'>¡Bienvenido a <font color='#BABD2F'>#Crazy</font><font color='#606090'>Cannons</font>!</p>En este juego los ratoncitos deberán esquivar los cañones que caerán del cielo e intentar sobrevivir.<br><br><p align='center'>_____</p>‏<font color='#CB546B'> »Comandos del teclado</font><br> <font color='#92CF91'>»Barra espaciadora»</font> Hace que tu ratón haga un super salto. <font color='#92CF91'>»E»</font> Hace que tu ratón se convierta en gigante por 5 segundos. --Requiere 10 puntos.<br><p align='center'>_____</p><p align='center'>Estás personas han ayudado de alguna manera, con un código, etc.<br><font color='#009D9D'>Hackinzkt</font><font color='#6C77C1'>#0000</font>, <font color='#009D9D'>Athesdrake</font><font color='#6C77C1'>#0000</font>, <font color='#009D9D'>Minstens</font><font color='#6C77C1'>#0000</font>, <font color='#009D9D'>Fly</font><font color='#6C77C1'>#8215</font><br><font color='#EB1D51'>❤</font> Gracias <font color='#EB1D51'>❤</font></p>",name,200,100,400)
  94. end
  95. end
  96.  
  97. --[[local power = 50
  98. local players = {}
  99.  
  100. function eventNewPlayer(name)
  101. if (not players[name]) then
  102. players[name] = {
  103. canJump = true
  104. }
  105. end
  106. system.bindKeyboard(name,1,true)
  107. system.bindKeyboard(name,32,true)
  108. end
  109.  
  110. function eventNewGame()
  111. for k, v in next, players do v.canJump = true end
  112. end
  113.  
  114. function eventKeyboard(name, key)
  115. if (key == 1) then
  116. tfm.get.room.playerList[name].isJumping = true
  117. elseif (key == 32) then
  118. if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
  119. players[name].canJump = false
  120. tfm.exec.movePlayer(name,0, 0,false,0,(-power))
  121. end
  122. end
  123. end]]--
  124.  
  125. survive()
  126.  
  127.  
  128. local power = 150
  129.  
  130. local players = {}
  131.  
  132. function eventNewPlayer(name)
  133. if (not players[name]) then players[name] = { canJump = true } end
  134. system.bindKeyboard(name, 1, true);system.bindKeyboard(name, 32, true)
  135. end
  136. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  137.  
  138. function eventNewGame()
  139. for k, v in next, players do v.canJump = true end
  140. end
  141.  
  142. function eventKeyboard(name, key)
  143. if (key == 1) then
  144. tfm.get.room.playerList[name].isJumping = true
  145. elseif (key == 32) then
  146. if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
  147. players[name].canJump = false;tfm.exec.movePlayer(name, 0, 0, false, 0, (- power))
  148. end
  149. end
  150. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement