Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Mousellon
- -- Créditos:Brenower
- -- Tables
- data={};
- maps={"0","4560949","@4701122","@4701807","@4701827","@4701807"};
- lang={
- BR={
- ["dr"]="R";
- };
- INT={
- ["dr"]="R";
- };
- };
- mg={
- ["cmm"]="BR";
- ["s"]=10;
- ["b"]=0;
- };
- -- Inicio do script
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.newGame(maps[math.random(#maps)])
- ui.addTextArea(1,"<TI><p align='center'><J>Ballua</p><font size='12'><N><br />Bem vindo ao mini game Ballua!<br /><br /><VP>Objetivo : <N>Chegar a toca com o queijo.<br /><br /><VP>Como jogar : <N>Pressione a tecla Space(Espaço) ou a seta de baixo para virar um balão, caso você seja um você pode apertar a tecla novamente e ir para onde o balão está.<br /><br /><N2>Pronto para jogar?",NIL,275,100,250,200,1,1,0.8,true)
- ui.addTextArea(2,"<p align='center'><a href='event:closeh'><b>X</b></a></p>",player,275,73,15,15,1,1,0.8,true)
- for i in pairs(tfm.get.room.playerList) do
- mg.s=mg.s+1;
- nD={
- ["id"]=id;
- ["c"]=false;
- ["win"]=false;
- ["time"]=os.time();
- ["i"]=false;
- ["t"]=0;
- };
- data[i] = nD;
- data[i].t = mg.s;
- id=tfm.exec.addShamanObject(1,3000,3000)
- data[i].id = id
- tfm.exec.bindKeyboard(i,32,false,true)
- tfm.exec.bindKeyboard(i,40,false,true)
- end
- -- Eventos do teclado
- function eventKeyboard(player,key,down,x,y)
- if y >= 0 and y <= 400 and x >= 0 and x <= 800 and data[player].win == false and data[player].time < os.time()-1800 then
- if tfm.get.room.playerList[player].isDead then
- tfm.exec.respawnPlayer(player)
- tfm.exec.movePlayer(player,tfm.get.room.objectList[data[player].id].x,tfm.get.room.objectList[data[player].id].y,false,0,0,false)
- data[player].i=false;
- ui.removeTextArea(data[player].t,NIL)
- if data[player].c == true then
- tfm.exec.giveCheese(player)
- end
- end
- if not tfm.get.room.playerList[player].isDead then
- data[player].i=true;
- data[player].time=os.time();
- mg.b=mg.b+1;
- tfm.exec.displayParticle(26,tfm.get.room.playerList[player].x,tfm.get.room.playerList[player].y,0,0,0,0,NIL)
- id=tfm.exec.addShamanObject(28,x,y,0,0,0,true)
- tfm.exec.removeObject(data[player].id)
- data[player].id = id;
- tfm.exec.killPlayer(player)
- end
- end
- end
- -- Jogador pega o queijo
- function eventPlayerGetCheese(player)
- data[player].c = true;
- end
- -- Jogador ganha a partida
- function eventPlayerWon(player)
- data[player].win = true;
- end
- -- Novo jogo
- function eventNewGame()
- mg.b=0;
- tfm.exec.setGameTime(63)
- for i in pairs(tfm.get.room.playerList) do
- data[i].c = false;
- data[i].win = false;
- data[i].i = false;
- tfm.exec.killPlayer(i)
- tfm.exec.respawnPlayer(i)
- ui.removeTextArea(data[i].t,NIL)
- id=tfm.exec.addShamanObject(1,3000,3000)
- data[i].id=id;
- end
- end
- -- Loop
- function eventLoop(ct,rt)
- tfm.exec.setUIMapName("<BL>"..tfm.get.room.currentMap.." - <N>Balões criados : <V>"..mg.b.."")
- if rt <= 0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- for i in pairs(tfm.get.room.playerList) do
- if data[i].i == true then
- ui.addTextArea(data[i].t,""..i.."",NIL,tfm.get.room.objectList[data[i].id].x-25,tfm.get.room.objectList[data[i].id].y-35,NIL,NIL,1,1,0.3)
- tfm.exec.displayParticle(2,tfm.get.room.objectList[data[i].id].x,tfm.get.room.objectList[data[i].id].y,0,0,0,0,i)
- tfm.exec.displayParticle(1,tfm.get.room.objectList[data[i].id].x,tfm.get.room.objectList[data[i].id].y+7,0,0,0,0,i)
- tfm.exec.displayParticle(13,tfm.get.room.objectList[data[i].id].x,tfm.get.room.objectList[data[i].id].y+14,0,0,0,0,i)
- end
- end
- end
- -- Jogador morre
- function eventPlayerDied(player)
- ui.addTextArea(0,"<p align='center'><R><a href='event:r'>"..lang[mg.cmm].dr.."</a></p>",player,5,20,20,20,1,1,0.7)
- end
- -- Callbacks
- function eventTextAreaCallback(id,player,link)
- if link == [[r]] then
- ui.removeTextArea(data[player].t,NIL)
- data[player].i=false;
- data[player].c = false;
- tfm.exec.respawnPlayer(player)
- ui.removeTextArea(0,player)
- end
- if link == [[closeh]] then
- ui.removeTextArea(1,player)
- ui.removeTextArea(2,player)
- end
- end
- -- Novo jogador entra na sala
- function eventNewPlayer(player)
- if not data[player] then
- mg.s=mg.s+1;
- nD={
- ["id"]=id;
- ["c"]=false;
- ["win"]=false;
- ["time"]=os.time();
- ["i"]=false;
- ["t"]=0;
- };
- data[player] = nD;
- data[player].t = mg.s;
- end
- id=tfm.exec.addShamanObject(1,3000,3000)
- data[player].id = id
- tfm.exec.bindKeyboard(player,32,false,true)
- tfm.exec.bindKeyboard(player,40,false,true)
- end
Advertisement
Add Comment
Please, Sign In to add comment