Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapas={7223062,7054603,7054531,7054546,7054560,7054552,7052544,7052537,7202743,7052522,7051720,7050627,7051652,7051630,7051619,7051569,7051547,7050402,7050558,7050503,7050581,7050580,7050562 ,70505521,7046681,7047815,7047835,7047897,7048753,7049425,7049270,7049421,7049292,7050189,7049463,7050308,7050400,7050402,7049463}
- data={}
- vivos = 5
- p=0
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame()
- textarea=ui.addTextArea
- function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,active)
- --if not backgroundColor then backgroundColor=0x324650 end
- --if not borderColor then borderColor=0x000001 end
- if active then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
- end
- textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
- end
- function eventPlayerGetCheese(name)
- tfm.exec.killPlayer(name)
- if tfm.get.room.playerList[name] then
- tfm.exec.addShamanObject(tfm.enum.shamanObject.chicken,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
- for i=1,20 do
- tfm.exec.displayParticle(13, tfm.get.room.playerList[name].x+math.random(-10,10), tfm.get.room.playerList[name].y+math.random(-10,10),math.random(-math.random(5,10),math.random(5,10)),math.random(-math.random(5,10),math.random(5,10)))
- end
- end
- end
- function eventNewGame()
- tfm.exec.setGameTime(120)
- vivos=0
- for i,v in pairs(tfm.get.room.playerList) do -- i = nome, v = info
- vivos=vivos+1;
- tfm.exec.giveMeep(i)
- end
- end
- function eventLoop(time,remaining)
- p=time
- if remaining < 1000 or vivos <= 0 then -- se o tempo do mapa está menor que 1 ou seja 0, ou não tem nenhum vivo
- tfm.exec.newGame(mapas[math.random(#mapas)])
- if not winner and not (remaining < 1000) then
- tfm.exec.chatMessage("<B>Ninguém venceu.</B>")
- elseif not winner and remaining < 1000 then
- tfm.exec.chatMessage("<N><B>O tempo acabou e ninguém venceu.</B></N>")
- end
- end
- if vivos <= 1 then
- winner = false
- eventPlayerDied()
- end
- end
- function eventPlayerDied(name)
- vivos=vivos-1;
- if vivos <= 1 then
- for i,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then -- verefica se o jogador não morreu
- tfm.exec.giveCheese(i)
- tfm.exec.playerVictory(i)
- name = i
- tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x-12, tfm.get.room.playerList[name].y,0,-5)
- tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
- tfm.exec.displayParticle(29, tfm.get.room.playerList[name].x+12, tfm.get.room.playerList[name].y,0,-5)
- tfm.exec.displayParticle(34, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y-7,0,-5)
- end
- end
- end
- end
- function eventPlayerWon(name)
- vivos=vivos-1;
- winner = true
- data[name].wins = data[name].wins+1;
- tfm.exec.chatMessage("<B>"..name.."</B> venceu.")
- end
- function eventNewPlayer(name)
- if not data[name] then
- data[name]={
- wins=0
- }
- end
- for _,msg in pairs({"Olá <B>"..name.."</B> bem-vindo ao New Meep Attack.","Mate outros jogadores fazendo eles encostar no queijo com meep."}) do
- tfm.exec.chatMessage(msg,name)
- end
- end
- tfm.exec.setRoomMaxPlayers(30)
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement