Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Halloween 2013
- -- Créditos:Brenower
- -- Tables
- data={};
- mg={
- ["jackpot"]=0;
- ["gjack"]=25;
- ["s"]=0;
- ["ss"]=0;
- ["ddoce"]=1;
- players={};
- };
- -- Functions
- function jackpot()
- if mg.jackpot >= mg.gjack then
- local random = mg.players[math.random(#mg.players)]
- data[random].doces=data[random].doces+mg.jackpot;
- ui.addTextArea(8,"<ROSE><B>[•] [Halloween] "..random.." GANHOU O JACKPOT! ("..mg.jackpot.." DOCES)",NIL,3,380,800,20,1,1,0.5,true)
- mg.jackpot=0;
- mg.gjack=mg.gjack+132+mg.gjack;
- ui.addTextArea(1,"<J><font size='14'>"..mg.jackpot,NIL,455,53,NIL,NIL,0,0,0,true)
- end
- end
- function gastar(maq,p,m1,m2,x,custo)
- if data[p].doces >= custo then
- ui.addTextArea(2,"<ROSE><font size='18'><B>|",p,x,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(3,"<ROSE><font size='18'><B>-",p,x+30,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(4,"<ROSE><font size='18'><B>|",p,x+30+30,224,NIL,NIL,0,0,0,true)
- data[p].x=x;
- data[p].doces=data[p].doces-custo;
- mg.jackpot=mg.jackpot+custo*mg.ddoce;
- end
- data[p].c1=math.random(m1,m2);
- data[p].c2=math.random(m1,m2);
- data[p].c3=math.random(m1,m2);
- data[p].gir=true;
- data[p].time=os.time();
- ui.addTextArea(1,"<J><font size='14'>"..mg.jackpot,NIL,455,53,NIL,NIL,0,0,0,true)
- ui.addTextArea(0,"<R>Doces : <J>"..data[p].doces,p,670,380,NIL,NIL,1,1,0.7,true)
- end
- function iguais(p)
- if data[p].c1 == data[p].c2 and data[p].c2 == data[p].c3 then
- data[p].doces=data[p].doces+data[p].c1*mg.ddoce;
- ui.addTextArea(0,"<R>Doces : <J>"..data[p].doces,p,670,380,NIL,NIL,1,1,0.7,true)
- end
- end
- function giveData(p)
- if not data[p] then
- nD={
- ["doces"]=200;
- ["time"]=0;
- ["gir"]=false;
- ["girs"]=0;
- ["x"]=0;
- ["c1"]=0;
- ["c2"]=0;
- ["c3"]=0;
- };
- data[p]=nD;
- end
- end
- function darDoces(qnt)
- for i in pairs(tfm.get.room.playerList) do
- data[i].doces=data[i].doces+qnt;
- end
- end
- -- Novo jogador entra na sala
- function eventNewPlayer(p)
- giveData(p)
- ui.addTextArea(0,"<R>Doces : <J>"..data[p].doces,p,670,380,NIL,NIL,1,1,0.7,true)
- ui.addTextArea(1,"<J><font size='14'>"..mg.jackpot,NIL,455,53,NIL,NIL,0,0,0,true)
- ui.addTextArea(5,"<font size='18'><a href='event:maq1'>»</a>",NIL,28,307,15,40,0,0,0,true)
- ui.addTextArea(6,"<font size='18'><a href='event:maq2'>»</a>",NIL,208,307,15,40,0,0,0,true)
- ui.addTextArea(7,"<font size='18'><a href='event:maq3'>»</a>",NIL,368,307,15,40,0,0,0,true)
- tfm.exec.respawnPlayer(p)
- table.insert(mg.players,p)
- end
- -- Inicio do script
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.newGame(3881622)
- tfm.exec.setUIMapName("Bar Halloween")
- ui.addTextArea(9,"<T>Duplo doce : <R>desativada",NIL,20,27,NIL,NIL,1,1,0.5,true)
- for i in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
- -- Callbacks
- function eventTextAreaCallback(id,p,link)
- if data[p].gir == false then
- if link == [[maq1]] then
- gastar(1,p,1,5,68,1)
- elseif link == [[maq2]] then
- gastar(2,p,5,10,247,2)
- elseif link == [[maq3]] then
- gastar(3,p,10,15,406,3)
- end
- end
- end
- -- Loop
- function eventLoop()
- mg.s=mg.s+0.5;
- if mg.s == 180 then
- darDoces(10)
- elseif mg.s == 300 then
- darDoces(10)
- mg.ddoce=2;
- ui.addTextArea(9,"<T>Duplo doce : <VP>ativado",NIL,20,27,NIL,NIL,1,1,0.5,true)
- elseif mg.s == 420 then
- darDoces(50)
- mg.ddoce=1;
- ui.addTextArea(9,"<T>Duplo doce : <R>desativada",NIL,20,27,NIL,NIL,1,1,0.5,true)
- end
- mg.s=0;
- jackpot()
- for i in pairs(tfm.get.room.playerList) do
- if data[i].gir == true then
- if data[i].girs ~= 6 then
- if data[i].time == 0 then
- ui.addTextArea(2,"<ROSE><font size='18'><B>-",i,data[i].x,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(3,"<ROSE><font size='18'><B>|",i,data[i].x+30,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(4,"<ROSE><font size='18'><B>-",i,data[i].x+30+30,224,NIL,NIL,0,0,0,true)
- data[i].time=1;
- else
- ui.addTextArea(2,"<ROSE><font size='18'><B>|",i,data[i].x,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(3,"<ROSE><font size='18'><B>-",i,data[i].x+30,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(4,"<ROSE><font size='18'><B>|",i,data[i].x+30+30,224,NIL,NIL,0,0,0,true)
- data[i].time=0;
- data[i].girs=data[i].girs+1;
- end
- else
- iguais(i)
- data[i].girs=0;
- data[i].gir=false;
- ui.addTextArea(2,"<VP><font size='18'>"..data[i].c1,i,data[i].x-3,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(3,"<VP><font size='18'>"..data[i].c2,i,data[i].x+24,224,NIL,NIL,0,0,0,true)
- ui.addTextArea(4,"<VP><font size='18'>"..data[i].c3,i,data[i].x+25+27,224,NIL,NIL,0,0,0,true)
- end
- end
- end
- end
- -- Jogador sai da sala
- function eventPlayerLeft(p)
- for i,v in ipairs(mg.players) do
- if v == p then
- table.remove(mg.players,i)
- end
- end
- end
- -- Jogador entra na toca
- function eventPlayerWon(p)
- tfm.exec.respawnPlayer(p)
- end
Advertisement
Add Comment
Please, Sign In to add comment