Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local maps = {"7524569","7524554","4059785","4027367","4084024","4027367","7561049","7561067"}
- local game = {
- alive = 0,
- players = {},
- start = 5,
- finished = false,
- ending = 10
- }
- mice = {}
- function disable()
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAllShamanSkills(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableMinimalistMode(true)
- tfm.exec.disableMortCommand(true)
- tfm.exec.disableWatchCommand(true)
- system.disableChatCommandDisplay('ayuda',true)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name,0)
- end
- function play(s)
- tfm.exec.newGame(s)
- tfm.exec.setGameTime(1)
- game.start = 5
- game.players = {}
- end
- function survive()
- disable()
- game.alive = 0
- for name,player in pairs(tfm.get.room.playerList) do
- game.alive = game.alive + 1
- end
- play(maps[math.random(#maps)])
- tfm.exec.setUIMapName("#Crazy<bl>Cannons")
- end
- function won(name)
- game.finished = true
- tfm.exec.setGameTime(10)
- game.ending = 10
- if game.alive == 1 then
- for i=1,1,1 do
- tfm.exec.giveCheese(game.players[i])
- tfm.exec.playerVictory(game.players[i])
- end
- 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)
- end
- end
- function eventPlayerDied(name)
- game.alive=game.alive-1
- if game.alive > 0 then
- if game.alive<=2 then
- local i = 0
- for name,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i = i + 1
- table.insert(game.players,i,name)
- end
- end
- won(name)
- end
- end
- end
- function eventPlayerWon(name)
- tfm.exec.setPlayerScore(name,5,true)
- mice[name].puntos = mice[name].puntos + 5
- print(""..name.." "..mice[name].puntos.."")
- end
- function eventLoop()
- if game.start == 0 then
- ui.setShamanName("¡Sobrevive!")
- for i=1,3 do
- tfm.exec.addShamanObject(17,math.random(800),math.random(-200,0),180)
- end
- else
- game.start = game.start - 0.5
- ui.setShamanName("El juego empezará en "..math.floor(game.start))
- end
- if game.finished == true then
- game.ending = game.ending - 0.5
- ui.setShamanName("El juego terminará en "..math.floor(game.ending))
- if game.ending == 0 then
- game.finished = false
- game.ending = 0
- survive()
- end
- end
- end
- function eventChatCommand(name,cmd)
- if cmd == "ayuda" then
- 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)
- end
- end
- --[[local power = 50
- local players = {}
- function eventNewGame()
- for k, v in next, players do v.canJump = true end
- end
- function eventKeyboard(name, key)
- if (key == 1) then
- tfm.get.room.playerList[name].isJumping = true
- elseif (key == 32) then
- if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
- players[name].canJump = false
- tfm.exec.movePlayer(name,0, 0,false,0,(-power))
- end
- end
- end]]--
- survive()
- local power = 150
- local players = {}
- function eventNewPlayer(name)
- mice[name] = {
- puntos = 0,
- }
- if (not players[name]) then players[name] = { canJump = true } end
- system.bindKeyboard(name, 1, true);system.bindKeyboard(name, 32, true)
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- function eventNewGame()
- for k, v in next, players do v.canJump = true end
- end
- function eventKeyboard(name, key)
- if (key == 1) then
- tfm.get.room.playerList[name].isJumping = true
- elseif (key == 32) then
- if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
- players[name].canJump = false;tfm.exec.movePlayer(name, 0, 0, false, 0, (- power))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement