Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data={}
- mapas={"5656921","5656978","5657023","4759983","5657689","5613250","5657856","5660156","3830099","5665749","5669319","5669465","1106226","3441279","5682168","3852671","3858131","5683436","5714048","4017512","3783232","5588949"};
- cm=os.time();
- ma="";
- function ranking(p)
- local sm = 0;
- for i,v in pairs(data) do
- if v.points > sm then
- sm = v.points;
- ma=i;
- if ma ~= i then
- tfm.exec.setNameColor(ma,0xDC9E0C)
- end
- end
- end
- end
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.newGame(mapas[math.random(#mapas)])
- function eventNewPlayer(p)
- if not data[p] then
- nD={
- ["time"]=os.time();
- ["points"]=0;
- };
- data[p]=nD;
- end
- data[p].time=os.time();
- tfm.exec.bindKeyboard(p,32,false,true)
- tfm.exec.setPlayerScore(p,0,false)
- end
- for i in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(i,32,false,true)
- eventNewPlayer(i)
- end
- function eventKeyboard(player,key,down,x,y)
- for i,v in pairs(tfm.get.room.playerList) do
- if x > v.x - 20 and x < v.x + 20 and y > v.y - 20 and y < v.y + 20 and i ~= player and not tfm.get.room.playerList[player].isDead and not v.isDead and data[player].time < os.time()-1000 and cm < os.time()-16000 then
- data[player].time=os.time();
- -- Congelar o jogaodor tfm.exec.addShamanObject(54,v.x,v.y,0,0,false)
- tfm.exec.killPlayer(i)
- data[player].points=data[player].points+1;
- tfm.exec.setPlayerScore(player,1,true)
- end
- end
- end
- function eventNewGame()
- tfm.exec.setGameTime(199)
- cm=os.time();
- end
- function eventLoop(ct,rt)
- local vi = 0;
- local p = "";
- if rt <= 0 then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- for i,v in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[i].isDead then
- vi=vi+1;
- p=i;
- end
- end
- if vi == 1 then
- vi=1;
- tfm.exec.giveCheese(p)
- tfm.exec.playerVictory(p)
- tfm.exec.setGameTime(6)
- end
- ranking()
- tfm.exec.setNameColor(ma,0xFF1CAE)
- local cores = {"0x000","0xFFF","0xBABD2F","0x00FF7F","0xB22222","0xFFF0F5","FF1CAE","2F7FCC","D2691E"};
- local cor = cores[math.random(#cores)]
- ui.addTextArea(0,"",nil,5,5,790,20,cor,0x000,0.4)
- end
- function eventChatCommand(p,cm)
- if cm == "next" then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- if cm == "ranking" then
- ranking(p)
- end
- if cm == "hack" then
- data[p].points=data[p].points+1;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement