Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- function eventPlayerDied(playerName)
- tfm.exec.respawnPlayer(playerName)
- end
- tfm.exec.disableAfkDeath(true)
- function eventChatCommand(p,cm)
- if cm == [[mort]] then
- tfm.exec.killPlayer(p)
- end
- end
- red={}
- blue={}
- function makeTeams()
- local playerList={}
- for name,player in pairs(tfm.get.room.playerList) do
- table.insert(playerList,name)
- end
- for i=1,#playerList,1 do
- local index=math.random(#playerList)
- local name=playerList[index]
- if i%2==0 then
- table.insert(red,name)
- else
- table.insert(blue,name)
- end
- table.remove(playerList,index)
- end
- end
- makeTeams()
- ranking={};
- function estaNaTabela(player)
- for i = #ranking,1,-1 do
- if ranking == player then
- return true;
- end
- end
- return false;
- end
- function verRanking(player)
- for i = #ranking,1,-1 do
- table.remove(ranking,i)
- end
- for i = 0,3 do
- local score = -1;
- local pl = nil;
- for p,v in pairs(tfm.get.room.playerList) do
- if v.score > score and not estaNaTabela(p) then
- score=v.score;
- pl=p;
- end
- end
- table.insert(ranking,pl)
- end
- for i = #ranking,1,-1 do
- print(ranking)
- end
- end
- verRanking()
- -- Mapas
- mapas={"@4953687","@5032745","@1979131","@260384","@5650267","@229827","@161730","@3638794","@1856349","@4238784","@4148332","@210188","@1368233 ","@214660","@1525272","@1637638 ","@327130","@556426","@208914"}
- -- Nova rounda
- function nextRound()
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- -- Novo jogo
- function eventNewGame()
- vivo=0
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- end
- tfm.exec.setUIMapName("RaciRun" )
- for i in pairs(tfm.get.room.playerList) do
- end
- end
- -- Jogador morre
- function eventPlayerDied(name)
- vivo=vivo-1
- end
- -- Jogador ganha
- function eventPlayerWon(name)
- vivo=vivo-1
- end
- -- Nova ronda
- nextRound();
- function eventLoop(tempoPassado, tempoFaltando)
- if vivo == 0 or tempoFaltando < 1000 then
- nextRound();
- end
- end
- ui.addTextArea(0,"<font color='#855924' align='center' size='20'><b> <i><s> #RacinRun </s></i></font><font size='26' color='#855924' align='center' face='Soopafresh'><br> <font face='arial' size='12'><br><b><J><br><br><b><font size='14'>Olá pessoal bem-vindos ao <N>#RacinRun</N>. Digitem <N>H</N> para mais informações! <R>Obs.: O H ainda não funciona</R> <R> <j> <V> <br><br><ch><font size='12'><j>",playerName,200,125,380,170, 0x3E3D3C, 0xF9E1AF, 0.8, true)
- ui.addTextArea(1,"<p align='center'><font color='#855924'><B><a href='event:close'>X</a>",player,568,112,19,18,0xFF4100,0x313131,1,true)
- function eventTextAreaCallback(textAreaId, player, callback)
- if(callback == "close") then
- ui.removeTextArea(0,player)
- ui.removeTextArea(1,player)
- end
- end
- nextRound();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement