Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lifes = 0
- deads = 0
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
- ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
- p = {}
- data = {}
- remove = {}
- spawn = os.time();
- vivos = 0;
- function eventNewGame()
- lifes = 0
- deads = 0
- ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
- end
- function eventLoop(t,r)
- for i,v in ipairs(remove) do
- if v.time <= os.time()-3000 then
- tfm.exec.removeObject(v.cn)
- table.remove(remove, i)
- end
- end
- if r <= 0 then
- tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
- end
- end
- function eventPlayerDied(name)
- vivos=vivos-1;
- deads = deads + 1
- lifes = lifes - 1
- ui.setMapName("<CS>[Sobrevivite]</CS> <BL>|</BL> <N>Ratos Vivos : <V>"..lifes.."</V></N> <BL>|</BL> <N>Ratos Mortos : <V>"..deads.."</V>")
- local a = 0
- for i,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- a = a + 1
- end
- end
- if a < 1 then
- tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
- end
- end
- function eventPlayerWon(name)
- vivos=vivos-1;
- data[name].wins = data[name].wins + 1
- ui.addTextArea(0,"<font color='#FFFFFF'>Jogadores/Pontos : \n<VI>★"..table.concat(p, '\n').."</VI> = <font color='#FFD100'>"..data[nome].wins.."",nil,680,28,115,0,0x153139,0x132C33,1,true)
- if vivos < 1 then
- tfm.exec.newGame('<C><P F="2" /><Z><S><S L="155" H="58" X="77" Y="115" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="420" H="58" Y="197" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="723" Y="110" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" X="723" H="58" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="77" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="155" H="58" X="418" Y="372" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,1" Y="344" T="47" X="77" /><P P="0,0" Y="343" T="46" X="14" /><P X="726" Y="349" T="47" P="0,0" /><P P="0,0" Y="341" T="46" X="787" /><F Y="339" X="412" /><T Y="86" X="77" /></D><O /></Z></C>')
- end
- end
- function eventKeyboard(name, key, down, x, y)
- tfm.get.room.playerList[name].x = x
- tfm.get.room.playerList[name].y = y
- if (key == 2) then
- tfm.get.room.playerList[name].isFacingRight = true
- elseif (key == 0) then
- tfm.get.room.playerList[name].isFacingRight = false
- elseif (key == 3) and not tfm.get.room.playerList[name].isDead then
- if data[name].spawn < os.time()-5000 then
- local obj
- if tfm.get.room.playerList[name].isFacingRight then
- obj = tfm.exec.addShamanObject(17,x+2,y+8,90)
- else
- obj = tfm.exec.addShamanObject(17,x-2,y+8,-90)
- end
- table.insert(remove, {time=os.time(),cn=obj})
- data[name].spawn = os.time();
- end
- end
- end
- function eventNewPlayer(name)
- table.insert(p,name)
- data[name] ={
- wins = 0,
- spawn = 0,
- }
- local text=''
- for name in pairs(tfm.get.room.playerList) do
- if data[name] then text=(text == "" and "<VI>"..name.."</VI> = <font color='#FFD100'>"..data[name].wins.."</font>" or text..'\n'.."<VI>"..name.."</VI> = <font color='#FFD100'>"..data[name].wins.."</font>") end
- end
- ui.addTextArea(0,"<font color='#FFFFFF'>Jogadores/Pontos : \n"..text,nil,680,28,115,0,0x153139,0x132C33,1,true)
- for keys, k in pairs({0,1,2,3,32,17,69}) do
- tfm.exec.bindKeyboard(name,k,true,true)
- end
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- tfm.exec.giveMeep(all)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement