Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoScore(true)
- ui.setMapName("<font color='#FFE300'>Mice<font color='#0070FF'> Mania")
- data = {}
- p = {}
- local sonic = {}
- local knucles = {}
- local tails = {}
- local voando = {}
- local planar = {}
- time = os.time();
- function eventNewPlayer(name)
- table.insert(p,name)
- data[name] = {
- life = 3,
- wins = 0,
- dead = 0,
- rodada = 0,
- xp = 0,
- level = 0,
- time = 0,
- }
- --anel(name)
- status(name)
- for keys, k in pairs({32,17,83,87,38,40}) do
- tfm.exec.bindKeyboard(name,k,true,true)
- end
- ui.addTextArea(0,"",name,4,28,127,20,0x986742, 0x986742,1,true)
- ui.addTextArea(1,"<font size='11'><font face='Arial'>Espaço Para Mover-se",name,5,29,125,18,0x171311, 0x171311,1,true)
- ui.addTextArea(4,"eae",name,660,380,135,20,0x986742, 0x986742,1,true)
- ui.addTextArea(5,"<font size='12'><font face='Arial'>Personagem : - -",name,661,381,133,18,0x171311, 0x171311,1,true)
- ui.addTextArea(6,"ae",name,284,28,188,20,0x986742, 0x986742,1,true)
- ui.addTextArea(7,"<font size='15'><font face='Arial'><a href='event:escolha'> Escolha seu Personagem :",name,285,29,186,18,0x171311,0x171311,1,true)
- ui.addTextArea(15,"ae",name,741,28,55,20,0x986742, 0x986742,1,true)
- ui.addTextArea(16,"<font size='15'><font face='Arial'><a href='event:Perfil'> Perfil",name,742,29,53,18,0x171311, 0x171311,1,true)
- end
- function status(name)
- ui.addTextArea(3,"<font size='45'><font face='Arial'><font color='#FF0000'>❤",name,-7,356,0,0,0,0,1,true)
- ui.addTextArea(2,"<font size='20'>X"..data[name].life.."",name,25,375,0,0,0,0,1,true)
- if data[name].life == 3 then
- tfm.exec.respawnPlayer(name)
- end
- if data[name].life == 2 then
- tfm.exec.respawnPlayer(name)
- end
- if data[name].life == 1 then
- tfm.exec.respawnPlayer(name)
- end
- end
- function subLife(name,life)
- data[name].life = data[name].life - life
- if data[name].life <= 0 then
- data[name].life = 0
- tfm.exec.killPlayer(name)
- end
- status(name)
- end
- function eventPlayerLeft(name)
- local i = -1
- for _,nome in pairs(tfm.get.room.playerList) do
- if nome == name then
- i=_
- end
- end
- table.remove(tails,i)
- table.remove(sonic,i)
- table.remove(knucles,i)
- end
- function eventPlayerDied(name)
- subLife(name,1)
- data[name].dead = data[name].dead + 1
- end
- function eventPlayerWon(name)
- SubLevel(name,math.random(5,20))
- data[name].wins = data[name].wins + 1
- end
- function eventNewGame()
- for i,v in pairs(tfm.get.room.playerList) do
- data[i].rodada = data[i].rodada + 1
- end
- end
- function eventTextAreaCallback(id,name,call)
- if call == "escolha" then
- ui.addTextArea(8,"",name,4,26,792,400,1,1,80,true)
- ui.addTextArea(9,"",name,234,144,130,30,0x986742, 0x986742,1,true)
- ui.addTextArea(10,"<font size='20'><font face='Arial'><a href='event:Sonic'> Sonic",name,235,145,128,28,0x171311, 0x171311,1,true)
- ui.addTextArea(11,"",name,425,144,130,30,0x986742, 0x986742,1,true)
- ui.addTextArea(12,"<font size='20'><font face='Arial'><a href='event:Tails'> Tails",name,426,145,128,28,0x171311, 0x171311,1,true)
- ui.addTextArea(13,"",name,330,224,130,30,0x986742, 0x986742,1,true)
- ui.addTextArea(14,"<font size='20'><font face='Arial'><a href='event:Knucles'> Knuckles",name,331,225,128,28,0x171311, 0x171311,1,true)
- for id=6,7 do
- ui.removeTextArea(id,name)
- end
- end
- if call == "Sonic" then
- table.insert(sonic,name)
- tfm.exec.setNameColor(name,0x005EFF)
- ui.addTextArea(5,"<font size='12'><font face='Arial'>Personagem :<font size='12' color='#005EFF'> Sonic",name,661,381,133,18,0x171311, 0x171311,1,true)
- for id=8,14 do
- ui.removeTextArea(id,name)
- end
- end
- if call == "Tails" then
- table.insert(tails,name)
- tfm.exec.setNameColor(name,0xFFD100)
- ui.addTextArea(5,"<font size='12'><font face='Arial'>Personagem :<font size='12' color='#FFD100'> Tails",name,661,381,133,18,0x171311, 0x171311,1,true)
- for id=8,14 do
- ui.removeTextArea(id,name)
- end
- end
- if call == "Perfil" then
- nome = name
- if tfm.get.room.playerList[nome] then
- this = tfm.get.room.playerList[nome]
- ui.addTextArea(19,"",name,240,92,350,180,0x183942,0x29434A,1,true)
- ui.addTextArea(20,"<font size='20' face='Impact'><p align='center'><V>"..nome,name,308,102,215,30,0x1D434D,0x1D434D,0.5,true)
- ui.addTextArea(21,"<font size='12'><p align='center'>Comunidade : <V>"..this.community:lower():gsub('%a',string.upper,1).."</font>",name,308,145,215,20,0x1D434D,0x1D434D,0,true)
- ui.addTextArea(22,"<font size='15'><p align='center'>Vitórias: "..data[nome].wins.."\nMortes: "..data[nome].dead.."\nRodadas: "..data[nome].rodada.."",name,250,190,330,62,0x1D434D,0x1D434D,1,true)
- ui.addTextArea(23,"<p align='center'><a href='event:close'>Fechar",name,250,285,330,20,0x153139,0x132C33,1,true)
- ui.addTextArea(24,"",name,253,161,100,20,0x00889A,0x00889A,1,true)
- levelp(nome,name)
- else
- ui.addPopup(0,3,"<font size ='14' color='#FF00DE'>[•]</font><font color='#FED000' size='14'> O Jogador <font color='#00F9FE'>"..nome.."</font> Ele não se Encontra na Sala.",name,300,200,300,true)
- end
- end
- if call == "close" then
- for id=19,27 do
- ui.removeTextArea(id,name)
- end
- end
- if call == "Knucles" then
- table.insert(knucles,name)
- tfm.exec.setNameColor(name,0xFF0000)
- ui.addTextArea(5,"<font size='12'><font face='Arial'>Personagem :<font size='11' color='#FF0000'> Knuckles",name,661,381,133,18,0x171311, 0x171311,1,true)
- for id=8,14 do
- ui.removeTextArea(id,name)
- end
- end
- end
- function split(t,s)
- local a={}
- for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
- table.insert(a,i)
- end
- return a
- end
- function eventChatCommand(name,cmd)
- local arg = split(cmd, " ")
- if arg[1] == "p" then
- if arg[2] then
- nome = arg[2]:lower():gsub('%a', string.upper, 1)
- else
- nome = name
- end
- if tfm.get.room.playerList[nome] then
- this = tfm.get.room.playerList[nome]
- ui.addTextArea(19,"",name,240,92,350,180,0x183942,0x29434A,1,true)
- ui.addTextArea(20,"<font size='20' face='Impact'><p align='center'><V>"..nome,name,308,102,215,30,0x1D434D,0x1D434D,0.5,true)
- ui.addTextArea(21,"<font size='12'><p align='center'>Comunidade : <V>"..this.community:lower():gsub('%a',string.upper,1).."</font>",name,308,145,215,20,0x1D434D,0x1D434D,0,true)
- ui.addTextArea(22,"<font size='15'><p align='center'>Vitórias: "..data[nome].wins.."\nMortes: "..data[nome].dead.."\nRodadas: "..data[nome].rodada.."",name,250,190,330,62,0x1D434D,0x1D434D,1,true)
- ui.addTextArea(23,"<p align='center'><a href='event:close'>Fechar",name,250,285,330,20,0x153139,0x132C33,1,true)
- ui.addTextArea(24,"",name,253,161,100,20,0x00889A,0x00889A,1,true)
- levelp(nome,name)
- else
- ui.addPopup(0,3,"<font size ='14' color='#FF00DE'>[•]</font><font color='#FED000' size='14'> O Jogador <font color='#00F9FE'>"..nome.."</font> Ele não se Encontra na Sala.",name,300,200,300,true)
- end
- end
- end
- function levelp(nome,name)
- ui.addTextArea(25,"<font color='#FFEF00'>Level: "..data[nome].level.."",name,253,141,0,0,0x00000,0x00000,1,true)
- ui.addTextArea(26,"",name,253,161,data[nome].xp,20,0x01CAE6,0x01CAE6,1,true)
- ui.addTextArea(27,"<font color='#FFEF00'>Xp: "..data[nome].xp.."/100",name,273,161,0,0,0x00000,0x00000,1,true)
- end
- function SubLevel(name,xp)
- data[name].xp = data[name].xp + xp
- if data[name].xp >= 100 then
- data[name].xp = 100
- data[name].level = data[name].level + 1
- data[name].xp = data[name].xp - 100
- end
- end
- function eventKeyboard(name, key, down, x, y)
- if key == 32 and not tfm.get.room.playerList[name].isDead then
- for _,nome in pairs(sonic) do
- if nome == name then
- if tfm.get.room.playerList[name].isFacingRight then
- tfm.exec.movePlayer(name,0,0,true,50,0,true)
- tfm.exec.displayParticle(9,x,y,math.random(-1.1),vx,math.random(1.-1),ay,nil)
- else
- tfm.exec.movePlayer(name,0,0,true,-50,0,true)
- tfm.exec.displayParticle(9,x,y,math.random(-1.1),vx,math.random(1.-1),ay,nil)
- end
- end
- end
- end
- if key == 32 and not tfm.get.room.playerList[name].isDead then
- for _,nome in pairs(tails) do
- if nome == name then
- table.insert(voando,name)
- tfm.exec.displayParticle(2,x,y,math.random(0.15),math.random(-0.5),0,-5,nil)
- end
- end
- end
- if (key == 83 or key == 40) then
- local i = -1
- for _,nome in pairs(voando) do
- if nome == name then
- i=_
- end
- end
- table.remove(voando,i)
- end
- if key == 32 and not tfm.get.room.playerList[name].isDead then
- if data[name].time < os.time()-500 then
- for _,nome in pairs(knucles) do
- if nome == name then
- if y < 200 then
- if tfm.get.room.playerList[name].isFacingRight then
- tfm.exec.displayParticle(13,x,y,math.random(-1.1),vx,math.random(1.-1),ay,nil)
- tfm.exec.movePlayer(name,0,0,false,0,-12,true)
- tfm.exec.movePlayer(name,0,0,false,0,-14,true)
- else
- tfm.exec.displayParticle(13,x,y,math.random(-1.1),vx,math.random(1.-1),ay,nil)
- tfm.exec.movePlayer(name,0,0,false,0,-12,true)
- tfm.exec.movePlayer(name,0,0,false,0,-14,true)
- data[name].time = os.time();
- end
- end
- end
- end
- end
- end
- end
- function eventLoop()
- for _,nome in pairs(voando) do
- tfm.exec.movePlayer(nome,0,0,true,0,-70,true)
- end
- for i,v in pairs(tfm.get.room.playerList) do
- if v.y < 48 then
- tfm.exec.movePlayer(i, 0, 0, false, 0, 150, true)
- tfm.exec.movePlayer(i, 0, 0, false, math.random(-100,100), 0, true)
- end
- end
- end
- for i,v in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement