Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- variaveis
- listaNegra = {}
- tfm.exec.disableAutoScore ( true )
- tfm.exec.disableAutoShaman ( true )
- tfm.exec.disableAutoTimeLeft ( true )
- tfm.exec.disableMortCommand ( true )
- tfm.exec.setGameTime ( 300, true )
- tfm.exec.disableAutoNewGame ( true )
- tfm.exec.disableAfkDeath ( true )
- bombTime = {}
- bombX = {}
- bombY = {}
- --rotação de mapas v
- rotacao = {"@7375532", "@7376059", "@7376057", "@7377575", "@7395456", "@7416636", "@7415964", "@7472244"}
- -- resto v
- function eventNewGame ()
- mapaescolhido = rotacao[math.random(1, 8)]
- tfm.exec.newGame ( mapaescolhido, false )
- tfm.exec.setGameTime ( 300, true )
- end
- -- pisos especiais vv
- --bomba vv
- function bomba (n)
- bombTime[tfm.get.room.playerList[n].id] = bombTime[tfm.get.room.playerList[n].id] - 1
- bomba2 (bombX[tfm.get.room.playerList[n].id], bombY[tfm.get.room.playerList[n].id], n)
- end
- function bomba2 (bombX, bombY, n)
- if (bombTime[tfm.get.room.playerList[n].id] == 6) then
- tfm.exec.displayParticle ( 22, bombX, bombY, -1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 22, bombX, bombY, 1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 22, bombX, bombY, 0, 1, 0, 0, nil)
- tfm.exec.displayParticle ( 22, bombX, bombY, 0, -1, 0, 0, nil)
- end
- if (bombTime[tfm.get.room.playerList[n].id] == 4) then
- tfm.exec.displayParticle ( 24, bombX, bombY, -1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 24, bombX, bombY, 1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 24, bombX, bombY, 0, 1, 0, 0, nil)
- tfm.exec.displayParticle ( 24, bombX, bombY, 0, -1, 0, 0, nil)
- end
- if (bombTime[tfm.get.room.playerList[n].id] == 2) then
- tfm.exec.displayParticle ( 21, bombX, bombY, -1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 21, bombX, bombY, 1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 21, bombX, bombY, 0, 1, 0, 0, nil)
- tfm.exec.displayParticle ( 21, bombX, bombY, 0, -1, 0, 0, nil)
- end
- if (bombTime[tfm.get.room.playerList[n].id] == 0) then
- tfm.exec.displayParticle ( 3, bombX, bombY, -1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 3, bombX, bombY, 1, 0, 0, 0, nil)
- tfm.exec.displayParticle ( 3, bombX, bombY, 0, 1, 0, 0, nil)
- tfm.exec.displayParticle ( 3, bombX, bombY, 0, -1, 0, 0, nil)
- tfm.exec.explosion ( bombX, bombY, 10000, 300, true )
- tfm.exec.removePhysicObject ( tfm.get.room.playerList[n].id )
- listaNegra[tfm.get.room.playerList[n].id] = 1
- end
- end
- eventNewGame ()
- posicaoX = 1
- posicaoY = 2
- tipo = 0
- invocador = "opa"
- function invocarPiso (nome)
- if (listaNegra[tfm.get.room.playerList[nome].id] == 1) then
- tfm.exec.removePhysicObject ( tfm.get.room.playerList[nome].id )
- pisoaleatorio = {0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 14, 1, 2, 3, 4, 5, 6, 7, 10, 11, 14, 100}
- posicaoX = tfm.get.room.playerList[nome].x
- posicaoY = tfm.get.room.playerList[nome].y
- tipo = pisoaleatorio[math.random(1, 22)]
- if (tipo == 100) then
- bombTime[tfm.get.room.playerList[nome].id] = 7
- bombX[tfm.get.room.playerList[nome].id] = posicaoX
- bombY[tfm.get.room.playerList[nome].id] = posicaoY
- tfm.exec.addPhysicObject ( tfm.get.room.playerList[nome].id, posicaoX, posicaoY, { type = 12, width = 48, height = 48, foreground = false, friction = 0.2, restitution = 0.1, angle = 0, color=0x000000, miceCollision = true, groundCollision = false})
- listaNegra[tfm.get.room.playerList[nome].id] = 0
- tfm.exec.displayParticle ( 37, posicaoX, posicaoY, 0, 0, 0, 0, nil)
- else
- frictable = {[0]= 0.3, 0, 0, 0, 10, 0.3, 0.3, 0.3, 0.3, 0, 0.3, 0.3, 0.3, 0.3}
- resttable = {[0]= 0.2, 0.2, 1.2, 20, 0.2, 0.2, 0.2, 0.2, 0.2, 0, 0.2, 0.2, 0.2, 0.2}
- fric = frictable[tipo]
- rest = resttable[tipo]
- if (tipo == 14) then
- fric = math.random(frictable[0], frictable[13])
- rest = math.random(resttable[0], resttable[13])
- end
- tfm.exec.addPhysicObject ( tfm.get.room.playerList[nome].id, posicaoX, posicaoY, { type = tipo, width = 48, height = 48, foreground = false, friction = fric, restitution = rest, angle = 0, miceCollision = true, groundCollision = false})
- tfm.exec.displayParticle ( 37, posicaoX, posicaoY, 0, 0, 0, 0, nil)
- end
- end
- end
- function eventKeyboard ( jogador, codigoTecla, pressionando, posicaoX, posicaoY )
- if (codigoTecla == 32) then
- invocarPiso (jogador)
- end
- end
- function eventPlayerDied ( jogador )
- tfm.exec.respawnPlayer ( jogador )
- end
- -- comandos v
- system.disableChatCommandDisplay ( "start", true )
- system.disableChatCommandDisplay ( "r", true )
- system.disableChatCommandDisplay ( "remove", true )
- system.disableChatCommandDisplay ( "skip", true )
- function eventChatCommand ( jogador, comando )
- if (comando == "start") then
- start(jogador)
- end
- if (comando == "r") then
- tfm.exec.killPlayer ( jogador )
- tfm.exec.respawnPlayer ( jogador )
- end
- if (comando == "remove") then
- tfm.exec.removePhysicObject ( tfm.get.room.playerList[jogador].id )
- end
- if (comando == "skip") then
- eventNewGame ()
- end
- end
- function eventPlayerWon ( jogador, tempo, tempoRespawn )
- tfm.exec.respawnPlayer ( jogador )
- end
- --ajuda v
- function ajuda (clicker)
- ui.addPopup ( 76, 0, "<html><b><font color='#BABD2F'><p align='center'>Ajuda</p></font></b><br/><b><font color='#009D9D'>- Instruções:</font></b><br/><br/><font color='#6C77C1'>Aperte espaço para invocar os pisos. Seu objetivo é construir uma <b>ponte</b> até o queijo, e depois outra para retornar. Você pode fazer isso com um amigo ou sozinho, mas alguns mapas são difíceis de se completar sem ajuda.</font><br/><br/><b><font color='#009D9D'>- Comandos:</font></b><br/><br/><font color='#6C77C1'>!r - Usado para respawnar</font><br/><font color='#6C77C1'>!remove - Remove o seu piso</font><br/><font color='#6C77C1'>!skip - Pula o mapa</font></html>", clicker, 200, 110, 400, true )
- end
- ui.addTextArea ( 1, "<a href='event:teste'>Ajuda", nil, 6, 376, 0, 0, 0x324650, 0x213540, 1, true )
- function eventTextAreaCallback ( id, jogador, callback )
- if (id == 1) then
- ajuda (jogador)
- end
- end
- function eventNewPlayer ( jogador )
- system.bindKeyboard ( jogador , 32, true, true)
- system.bindKeyboard ( jogador , 65, true, true)
- tfm.exec.respawnPlayer ( jogador )
- listaNegra[tfm.get.room.playerList[jogador].id] = 1
- ui.addTextArea ( 1, "<a href='event:teste'>Ajuda", nil, 6, 376, 0, 0, 0x324650, 0x213540, 1, true)
- bombTime[tfm.get.room.playerList[jogador].id] = -1
- bombX[tfm.get.room.playerList[jogador].id] = -1
- bombY[tfm.get.room.playerList[jogador].id] = -1
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- --eventLoop v
- function eventLoop ( tempoAtual, tempoRestante )
- if (tempoRestante <= 0) then
- eventNewGame ()
- end
- table.foreach(tfm.get.room.playerList, bomba)
- end
Add Comment
Please, Sign In to add comment