Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. local maps = {"7524569","7524554","4059785","4027367","4084024","4027367","7561049","7561067"}
  2. local game = {
  3. alive = 0,
  4. players = {},
  5. start = 5,
  6. finished = false,
  7. ending = 10
  8. }
  9.  
  10. mice = {}
  11.  
  12. function disable()
  13. tfm.exec.disableAfkDeath(true)
  14. tfm.exec.disableAutoNewGame(true)
  15. tfm.exec.disableAllShamanSkills(true)
  16. tfm.exec.disableAutoScore(true)
  17. tfm.exec.disableAutoTimeLeft(true)
  18. tfm.exec.disableAutoShaman(true)
  19. tfm.exec.disableMinimalistMode(true)
  20. tfm.exec.disableMortCommand(true)
  21. tfm.exec.disableWatchCommand(true)
  22. system.disableChatCommandDisplay('ayuda',true)
  23. end
  24.  
  25. for name,player in pairs(tfm.get.room.playerList) do
  26. tfm.exec.setPlayerScore(name,0)
  27. end
  28.  
  29.  
  30. function play(s)
  31. tfm.exec.newGame(s)
  32. tfm.exec.setGameTime(1)
  33. game.start = 5
  34. game.players = {}
  35. end
  36.  
  37. function survive()
  38. disable()
  39. game.alive = 0
  40. for name,player in pairs(tfm.get.room.playerList) do
  41. game.alive = game.alive + 1
  42. end
  43. play(maps[math.random(#maps)])
  44. tfm.exec.setUIMapName("#Crazy<bl>Cannons")
  45.  
  46. end
  47.  
  48.  
  49.  
  50. function won(name)
  51. game.finished = true
  52. tfm.exec.setGameTime(10)
  53. game.ending = 10
  54. if game.alive == 1 then
  55. for i=1,1,1 do
  56. tfm.exec.giveCheese(game.players[i])
  57. tfm.exec.playerVictory(game.players[i])
  58.  
  59. end
  60. 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)
  61. end
  62. end
  63.  
  64. function eventPlayerDied(name)
  65. game.alive=game.alive-1
  66.  
  67. if game.alive > 0 then
  68. if game.alive<=2 then
  69. local i = 0
  70. for name,player in pairs(tfm.get.room.playerList) do
  71. if not player.isDead then
  72. i = i + 1
  73. table.insert(game.players,i,name)
  74. end
  75. end
  76. won(name)
  77. end
  78. end
  79. end
  80.  
  81.  
  82. function eventPlayerWon(name)
  83. tfm.exec.setPlayerScore(name,5,true)
  84. mice[name].puntos = mice[name].puntos + 5
  85. print(""..name.." "..mice[name].puntos.."")
  86. end
  87.  
  88. function eventLoop()
  89. if game.start == 0 then
  90. ui.setShamanName("¡Sobrevive!")
  91. for i=1,3 do
  92. tfm.exec.addShamanObject(17,math.random(800),math.random(-200,0),180)
  93. end
  94. else
  95. game.start = game.start - 0.5
  96. ui.setShamanName("El juego empezará en "..math.floor(game.start))
  97. end
  98. if game.finished == true then
  99. game.ending = game.ending - 0.5
  100. ui.setShamanName("El juego terminará en "..math.floor(game.ending))
  101. if game.ending == 0 then
  102. game.finished = false
  103. game.ending = 0
  104. survive()
  105. end
  106. end
  107. end
  108.  
  109. function eventChatCommand(name,cmd)
  110. if cmd == "ayuda" then
  111. 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)
  112. end
  113. end
  114.  
  115. --[[local power = 50
  116. local players = {}
  117.  
  118.  
  119. function eventNewGame()
  120. for k, v in next, players do v.canJump = true end
  121. end
  122.  
  123. function eventKeyboard(name, key)
  124. if (key == 1) then
  125. tfm.get.room.playerList[name].isJumping = true
  126. elseif (key == 32) then
  127. if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
  128. players[name].canJump = false
  129. tfm.exec.movePlayer(name,0, 0,false,0,(-power))
  130. end
  131. end
  132. end]]--
  133.  
  134. survive()
  135.  
  136.  
  137. local power = 150
  138.  
  139. local players = {}
  140.  
  141. function eventNewPlayer(name)
  142.  
  143. mice[name] = {
  144.  
  145. puntos = 0,
  146. }
  147.  
  148. if (not players[name]) then players[name] = { canJump = true } end
  149. system.bindKeyboard(name, 1, true);system.bindKeyboard(name, 32, true)
  150. end
  151.  
  152. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  153.  
  154. function eventNewGame()
  155. for k, v in next, players do v.canJump = true end
  156. end
  157.  
  158. function eventKeyboard(name, key)
  159. if (key == 1) then
  160. tfm.get.room.playerList[name].isJumping = true
  161. elseif (key == 32) then
  162. if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
  163. players[name].canJump = false;tfm.exec.movePlayer(name, 0, 0, false, 0, (- power))
  164. end
  165. end
  166. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement