Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoScore(true)
- Admin = "Hugotitas"
- vivos=0;
- data = {}
- mapas =
- {'<C><P F="0" L="1600" G="0,6" /><Z><S><S L="40" o="97018b" H="40" X="31" Y="369" T="12" P="0,0,0.3,1.5,60,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="19" o="d411" H="400" Y="201" T="12" X="28" /><S P="0,0,0.3,0.2,0,0,0,0" L="546" o="1e1100" H="36" Y="184" T="12" X="274" /><S P="0,0,0.3,0.2,0,0,0,0" L="547" o="d411" H="17" Y="169" T="12" X="274" /><S L="350" o="1e1100" H="36" X="715" Y="154" T="12" P="0,0,0.3,0.2,-10,0,0,0" /><S P="0,0,0.3,1.5,30,0,0,0" L="40" o="97018b" H="40" Y="284" T="12" X="967" /><S P="0,0,0.3,0.2,-10,0,0,0" L="352" o="d411" H="17" Y="139" T="12" X="712" /><S P="0,0,0.3,0.2,0,0,0,0" L="823" o="1e1100" X="576" Y="310" T="12" H="36" /><S P="0,0,0.3,0.2,0,0,0,0" L="825" o="d411" X="576" Y="296" T="12" H="19" /><S P="0,0,0.3,0.2,0,0,0,0" L="27" o="d411" X="975" Y="152" T="12" H="304" /><S L="1600" o="1e1100" H="27" X="803" Y="388" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="28" o="1e1100" H="93" Y="87" T="12" X="1163" /><S L="1600" o="d411" H="20" X="801" Y="381" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="584" o="1e1100" H="35" Y="19" T="12" X="1308" /><S P="0,0,0.3,0.2,0,0,0,0" L="29" o="d411" H="363" Y="220" T="12" X="1573" /><S P="0,0,0.3,0.2,0,0,0,0" L="586" o="d411" H="22" Y="31" T="12" X="1307" /><S L="39" o="1e1100" X="997" H="328" Y="164" T="12" P="0,0,3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="32" o="1e1100" H="402" Y="201" T="12" X="1585" /><S P="0,0,0.3,0.2,0,0,0,0" L="39" o="1e1100" H="230" Y="255" T="12" X="1285" /><S P="0,0,0,0.2,0,0,0,0" L="30" o="d411" H="234" Y="257" T="12" X="1266" /><S P="0,0,0.3,0.2,0,0,0,0" L="18" o="d411" H="94" Y="87" T="12" X="1157" /><S P="0,0,0.3,0.2,0,0,0,0" L="81" o="262626" X="1470" c="2" Y="325" T="12" H="45" /><S P="0,0,0.3,0.2,0,0,0,0" L="16" o="1a1a1a" H="27" Y="358" T="12" X="1471" /><S P="0,0,0.3,0.2,0,0,0,0" L="22" o="1d1100" H="400" Y="201" T="12" X="10" /><S L="945" o="1d1100" X="492" H="28" Y="15" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="945" o="d411" X="493" H="20" Y="25" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P X="1108" Y="369" T="6" P="0,1" /><F Y="334" X="1469" /><T Y="341" X="1470" /><DS Y="147" X="37" /></D><O /></Z></C>',5119521,7108733,7263304,'<C><P F="3" L="1600" G="0,7" /><Z><S><S L="20" H="18" X="367" Y="359" T="10" P="0,0,0.3,0,0,0,0,0" /><S H="50" L="20" X="73" c="2" N="" Y="343" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S H="232" L="55" X="40" c="2" N="" Y="253" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S X="60" L="33" H="368" c="2" N="" Y="192" T="5" P="0,0,0,0.2,-10,0,0,0" /><S L="382" o="1f1200" X="191" H="31" N="" Y="386" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="381" o="2cff00" X="191" H="19" N="" Y="377" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="368" L="33" X="16" c="1" N="" Y="184" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S H="34" L="421" X="590" c="2" N="" Y="383" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="38" X="473" H="63" Y="332" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="38" X="583" Y="335" T="1" m="" H="63" /><S P="0,0,0.3,9999,0,0,0,0" L="15" o="2f2f2f" H="32" Y="186" T="12" X="1027" /><S P="0,0,0,0.2,0,0,0,0" L="38" H="63" Y="334" T="1" m="" X="692" /><S L="15" o="2f2f2f" X="992" H="32" Y="183" T="12" P="0,0,0.3,9999,0,0,0,0" /><S L="14" o="2f2f2f" X="1011" H="51" Y="173" T="12" P="0,0,0.3,9999,0,0,0,0" /><S L="425" H="10" X="592" Y="404" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="41" X="805" Y="387" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="31" H="76" X="852" Y="368" T="10" P="0,0,0.3,0,0,0,0,0" /><S L="350" H="29" X="1345" Y="131" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="32" H="154" X="927" Y="337" T="10" P="0,0,0.3,0,0,0,0,0" /><S L="69" H="222" X="1006" Y="289" T="10" P="0,0,0.3,0,0,0,0,0" /><S L="80" H="268" X="839" Y="135" T="10" P="0,0,,0,0,0,0,0" /><S L="32" H="307" X="1086" Y="246" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="33" H="321" X="1172" Y="161" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="350" H="29" X="1331" Y="307" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="530" H="28" X="1336" Y="386" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="33" H="204" X="1582" Y="297" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="350" X="1426" H="29" Y="208" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="33" H="196" X="1583" Y="97" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="320" H="32" X="1409" Y="61" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S L="447" H="42" X="1376" Y="-20" T="5" P="0,0,0.3,0.2,0,0,0,0" /><S H="281" L="58" o="3b2000" X="1130" c="2" Y="232" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="54" L="408" o="3b2000" X="1363" c="2" Y="348" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="99" L="60" o="3b2000" X="1536" c="2" Y="272" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="72" L="323" o="3b2000" X="1349" c="2" Y="258" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="79" L="64" o="3b2000" X="1220" c="2" Y="183" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="48" L="316" o="3b2000" X="1409" c="2" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="70" L="53" o="3b2000" X="1543" c="2" Y="111" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="45" L="346" o="3b2000" X="1361" c="2" Y="98" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="79" L="64" o="3b2000" X="1219" c="2" Y="38" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="44" L="320" o="3b2000" X="1408" c="2" Y="23" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="23" o="5f5f5f" X="1534" H="18" Y="36" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="29" L="61" o="636363" X="1535" c="2" Y="16" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="782" X="403" H="57" Y="-30" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="50" X="1178" H="1000" Y="-538" T="1" m="" P="0,0,0,0.2,180,0,0,0" /></S><D><DS Y="354" X="43" /><P P="0,0" Y="367" T="47" X="319" /><P P="1,0" Y="367" T="46" X="369" /><P P="0,0" Y="205" T="43" X="536" /><P P="1,0" Y="373" T="42" X="419" /><P P="1,0" Y="366" T="118" X="473" /><P P="1,0" Y="366" T="118" X="588" /><P P="1,0" Y="365" T="118" X="699" /><T Y="30" X="1487" /><F Y="28" X="1350" /></D><O /></Z></C>',7263379,7263304}
- p = {}
- local sonic = {}
- local knucles = {}
- local tails = {}
- local voando = {}
- local planar = {}
- time = os.time();
- system.bindMouse(Admin, true)
- function eventMouse(Admin, x, y)
- print(""..x.." e "..y.."")
- end
- function eventNewPlayer(name)
- table.insert(p,name)
- data[name] = {
- life = 3,
- wins = 0,
- dead = 0,
- rodada = 0,
- xp = 0,
- level = 0,
- time = 0,
- anel = 0,
- first = 0,
- pos = 0,
- }
- aneu(name)
- status(name)
- tfm.exec.setPlayerScore(name,data[name].life)
- for keys, k in pairs({32,17,83,87,38,40}) do
- tfm.exec.bindKeyboard(name,k,true,true)
- tfm.exec.bindKeyboard(name,k,false,true)
- end
- ui.addTextArea(0,"",name,4,28,134,20,0x986742, 0x986742,1,true)
- ui.addTextArea(1,"<font size='12'><font face='Arial'>Espaço Para Mover-se",name,5,29,132,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 aneu(name)
- ui.addTextArea(28,"<font size='45'><font face='Arial'><font color='#FFE300'>O",name,-7,327,0,0,0,0,1,true)
- ui.addTextArea(29,"<font color='#FFFFFF' size='20'>X"..data[name].anel.."",name,25,338,0,0,0,0,1,true)
- end
- function start(name)
- end
- function status(name)
- ui.addTextArea(3,"<font size='35'><font face='Arial'><font color='#FF0000'>♥",name,-7,366,0,0,0,0,1,true)
- ui.addTextArea(2,"<font color='#FFFFFF' 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 start(name)
- end
- function subAnel(name,anel)
- data[name].anel = data[name].anel + anel
- if data[name].anel <= 0 then
- data[name].anel = 0
- end
- if data[name].anel >= 100 then
- data[name].life = data[name].life + 1
- tfm.exec.setPlayerScore(name,data[name].life)
- data[name].anel = 0
- end
- aneu(name)
- end
- function subLife(name,life)
- if data[name].anel <= 0 then
- data[name].life = data[name].life - life
- tfm.exec.setPlayerScore(name,data[name].life)
- if data[name].life <= 0 then
- data[name].life = 0
- tfm.exec.setPlayerScore(name,data[name].life)
- tfm.exec.killPlayer(name)
- end
- end
- status(name)
- end
- function eventPlayerLeft(name)
- local i = -1
- for _,nome in pairs(p) do
- if nome == name then
- i=_
- end
- end
- table.remove(tails,i)
- table.remove(sonic,i)
- table.remove(knucles,i)
- end
- function subAneu(name,anel)
- data[name].anel = data[name].anel - anel
- if data[name].anel <= 0 then
- data[name].anel = 0
- end
- aneu(name)
- end
- function eventPlayerDied(name)
- subAneu(name,math.random(1,5))
- subLife(name,1)
- data[name].dead = data[name].dead + 1
- local p = 0
- for player,name in pairs(tfm.get.room.playerList) do
- if not name.isDead then
- p = p + 1
- end
- end
- if p < 2 then
- tfm.exec.setGameTime(20)
- end
- if vivos == 0 then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- ui.setMapName("<font color='#FFE300'>Mice<font color='#0070FF'> Mania")
- end
- end
- function eventPlayerWon(name)
- data[name].pos = data[name].pos + 1
- SubLevel(name,math.random(5,20))
- data[name].wins = data[name].wins + 1
- vivos=vivos-1;
- if vivos < 2 then
- tfm.exec.setGameTime(5)
- end
- if data[name].pos == 1 then
- data[name].first = data[name].first + 1
- subAnel(name,math.random(15,20))
- end
- if data[name].pos == 2 then
- subAnel(name,math.random(10,15))
- end
- if data[name].pos == 3 then
- subAnel(name,math.random(5,10))
- end
- if data[name].pos >= 4 then
- subAnel(name,math.random(1,5))
- end
- end
- function eventNewGame()
- for i,v in pairs(tfm.get.room.playerList) do
- data[i].rodada = data[i].rodada + 1
- vivos=vivos+1;
- status(i)
- 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.."\nFirst: "..data[nome].first.."",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.."\nFirst: "..data[nome].first.."",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,40,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,-40,0,true)
- tfm.exec.displayParticle(9,x,y,math.random(-1.1),vx,math.random(1.-1),ay,name)
- 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()-200 then
- for _,nome in pairs(knucles) do
- if nome == name then
- if y > 20 then
- if tfm.get.room.playerList[name].isFacingRight then
- tfm.exec.displayParticle(13,x,y,0,0,0,0,nil)
- tfm.exec.movePlayer(name,0,0,false,0,-math.random(8,10),true)
- else
- tfm.exec.displayParticle(13,x,y,0,0,0,0,nil)
- tfm.exec.movePlayer(name,0,0,false,0,-math.random(8,10),true)
- end
- data[name].time = os.time();
- end
- end
- end
- end
- end
- end
- function eventLoop(t,r)
- 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
- if r <= 0 then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- ui.setMapName("<font color='#FFE300'>Mice<font color='#0070FF'> Mania")
- end
- end
- for i,v in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
- tfm.exec.newGame(mapas[math.random(#mapas)])
- ui.setMapName("<font color='#FFE300'>Mice<font color='#0070FF'> Mania")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement