Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AutoTimeLeft","AutoScore","PhysicalConsumables","DebugCommand","MinimalistMode"} do
- tfm.exec["disable"..f](true)
- end
- for _,g in next,{"p","rank"} do
- system.disableChatCommandDisplay(g,true)
- end
- tfm.exec.setRoomMaxPlayers(40)
- sudden=false
- winner=""
- data={}
- players_table={}
- increase=0
- intensity=40
- mices=0
- remain=10
- last_win=""
- times=1;
- enabled=false
- 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 eventRanking(name)
- local sc = {}
- for id, name in pairs(players_table) do
- sc[#sc+1] = {n=name,s=data[name].score,f=data[name].wins}
- end
- table.sort(sc,function(a,b) return a.s>b.s end)
- str1 = ''
- str2 = ''
- str3 = ''
- for k,v in pairs(sc) do
- if k < 11 then
- if str ~= '' then
- str1=str1.."<br><N>"..k.."° | <VP>"..v.n..""
- str2=str2.."<br><b><N>"..v.s.."</b>"
- str3=str3.."<br><N>"..v.f..""
- else
- str1="<J>"..k.."° | <VP>"..v.n..""
- str2="<J><b>"..v.s.."</b>"
- str3="<J>"..v.f..""
- end
- end
- end
- ui.addTextArea(8000,'<B><J><font size="13"><p align="center">Temporary Ranking',name,100,100,500,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8001,"<B><font size='13'><font face='Consolas'># Name Score Wins",name,110,110,480,20,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8002,"<B><font size='16'><font face='Consolas'>"..str1,name,110,130,480,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8003,"<p align='right'><font size='16'><font face='Consolas'>"..str2,name,400,130,60,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8004,"<p align='right'><font size='16'><font face='Consolas'>"..str3,name,485,130,60,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8006,"<p align='center'><font size='16'><R><a href='event:close'>Close</a>",name,300,350,210,20,0x3c5063,0x3c5063,nil,true)
- end
- function eventChatCommand(name,message)
- local arg = split(message, " ")
- 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
- ui.addTextArea(8003,'<B><J><font size="17"><p align="center">'..nome,name,245,95,315,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8004,"<font size='12'><b>Score: "..data[nome].score.."</b><br><br>Wins: "..data[nome].wins.."<br>Matches: "..data[nome].matches.."",name,255,125,290,90,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8005,"<R><p align='center'><B><a href='event:fechar'>Close</a>",name,255,210,290,20,0x3c5063,0x3c5063,nil,true)
- else
- tfm.exec.chatMessage("Função não permitida. (Você colocou a #tag no nome?)",name)
- end
- end
- if message == "rank" then
- eventRanking(name)
- end
- end
- function eventNewPlayer(name)
- system.bindMouse(name)
- if not data[name] then
- table.insert(players_table,name)
- data[name]={time=0,matches=0,wins=0,score=0,p1=false,p2=false,pcount=0}
- end
- tfm.exec.bindKeyboard(name,112,true,true)
- tfm.exec.bindKeyboard(name,113,true,true)
- tfm.exec.chatMessage("<br>Bem-vindo ao module temporário #clickwar!<br>Use o mouse para gerar uma explosão e matar os outros ratos!<br><br>Use o comando !p para ver o seu perfil e !rank para ver o ranking.<br><br>Module criado por Jessiewind26#2546 e Camilledrain#0000",name)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventMouse(name,x,y)
- if not tfm.get.room.playerList[name].isDead and enabled == true then
- if data[name].p1 == false then
- if data[name].time >= 2 then
- if data[name].p2 == true then
- tfm.exec.explosion(x,y,intensity,intensity*1.5,false)
- else
- tfm.exec.explosion(x,y,intensity/2,intensity*1.5,false)
- end
- data[name].time=0;
- tfm.exec.displayParticle(10,x,y,0,0,0,0,nil)
- end
- else
- if data[name].p2 == true then
- tfm.exec.explosion(x,y,intensity,intensity*1.5,false)
- else
- tfm.exec.explosion(x,y,intensity/2,intensity*1.5,false)
- end
- data[name].time=2;
- tfm.exec.displayParticle(10,x,y,0,0,0,0,nil)
- end
- end
- end
- function eventNewGame()
- ui.removeTextArea(1,nil)
- sudden=false
- tfm.exec.setGameTime(120)
- winner=""
- increase=0;
- remain=10
- enabled=false
- intensity=40
- prox=false;
- for name,player in pairs(tfm.get.room.playerList) do
- data[name].matches=data[name].matches+1
- data[name].p1=false
- data[name].p2=false
- data[name].pcount=0
- end
- end
- function eventLoop(pass,falt)
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].pcount >= 0 then
- data[name].pcount=data[name].pcount-1
- else
- data[name].p1=false
- data[name].p2=false
- break
- end
- end
- if sudden == true then
- intensity=intensity+2
- if falt < 20000 then
- intensity=intensity+1
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isDead then
- data[name].score=math.floor(data[name].score+(intensity/36))
- end
- end
- end
- if falt < 40000 and sudden == false and falt > 30000 then
- tfm.exec.chatMessage("<R>Modo ultra difícil habilitado!",nil)
- ui.addTextArea(1,"",nil,-1000,-1000,3000,3000,0x000001,0x000001,0.8,false)
- sudden=true;
- end
- if falt < 20000 and sudden == true and falt > 19000 then
- ui.addTextArea(1,"",nil,-1000,-1000,3000,3000,0x000001,0x000001,0.91,false)
- end
- if falt < 100 then
- tfm.exec.newGame("#10")
- end
- if prox == false then
- ui.setMapName("<N>Click War RTM v0.9.5 <BL>| <N>Intensidade: <b>"..intensity.."</b>")
- else
- ui.setMapName("<b>"..winner.."</b> <N>venceu a partida! Próxima partida em "..math.floor(falt/1000).." segundos.<")
- end
- remain=remain-0.5
- if remain <= 3 and remain >= 0.5 then
- ui.addTextArea(0,"<font size='33'><p align='center'>"..math.ceil(remain).."",nil,370,350,60,45,0x000001,0x000001,0.8,true)
- end
- if remain <= 0 then
- ui.removeTextArea(0,nil)
- enabled=true;
- end
- for name,player in pairs(tfm.get.room.playerList) do
- data[name].time=data[name].time+1
- end
- if enabled == true then
- increase=increase+0.5
- if increase >= 2 then
- if sudden == false then
- intensity=intensity+1
- increase=0;
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isDead then
- if pass > 30000 then
- data[name].score=math.floor(data[name].score+(intensity/24))
- end
- end
- end
- end
- end
- end
- end
- function eventPlayerDied(name)
- if name == last_win and times >= 2 then
- tfm.exec.chatMessage("A sequência de vitórias de <R>"..last_win.."<J> foi encerrada!")
- times=1
- end
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame("#10")
- elseif i==1 then
- winner=n;
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- data[n].wins=data[n].wins+1
- data[n].score=data[n].score+200
- tfm.exec.setGameTime(10)
- tfm.exec.setPlayerScore(n,1,true)
- prox=true;
- if winner == last_win then
- data[n].score=data[n].score+100
- times=times+1
- if times == 2 then
- tfm.exec.chatMessage("<J>"..last_win.." venceu <b>2</b> vezes seguidas!")
- elseif times == 3 then
- tfm.exec.chatMessage("<R><b>Enfurecido!</b><J>"..last_win.." venceu <b>3</b> vezes seguidas!")
- elseif times == 4 then
- tfm.exec.chatMessage("<R><b>Implacável!</b><J>"..last_win.." venceu <b>4</b> vezes seguidas!")
- elseif times == 5 then
- tfm.exec.chatMessage("<R><b>Supremo!</b><J>"..last_win.." venceu <b>5</b> vezes seguidas!")
- elseif times >= 6 then
- tfm.exec.chatMessage("<R><b>Lendário!</b><J>"..last_win.." venceu <b>"..times.."</b> vezes seguidas!")
- end
- end
- last_win=n
- end
- end
- tfm.exec.newGame("#10")
- function eventTextAreaCallback(id,name,callback)
- if callback == "fechar" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- end
- end
- if callback == "close" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- end
- end
- function eventKeyboard(name,key,down,x,y)
- if enabled == true then
- if not tfm.get.room.playerList[name].isDead and data[name].p1 == false and data[name].p2 == false then
- if key == 112 and data[name].score >= 1000 then
- data[name].p1=true
- data[name].score=data[name].score-1000
- data[name].pcount=16
- tfm.exec.chatMessage("<J>"..name.." usou o powerup Espíritos Rápidos!")
- end
- if key == 113 and data[name].score >= 400 then
- data[name].p2=true
- data[name].score=data[name].score-400
- data[name].pcount=20
- tfm.exec.chatMessage("<J>"..name.." usou o powerup Potência Duplicada!")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement