Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman();
- tfm.exec.disableAutoNewGame();
- tfm.exec.disableAutoTimeLeft();
- maps_, data, shootCN, c, difficulty = {6953348,7214244,6891734,1539148,6549805,495880,6684273,1026249,6622204,741041,6631961,1545834,291643,1485498,860865,6240668,802958,7042435,2842113,6938129,1794873,311496,392646,7049134,1519483,7142792,3540608,852617,279689,399420,281649,289964,390649,2284187,289932,281462,866256,6999034,280159,3107377,307930,6789296,1659906,306360,6793381,697561,3587860,290546,6786189,481676}, {}, os.time(), {x=nil,y=nil,mx=math.random(80,180),my=math.random(-20,20),isFacingRight=false,dir=0,angle=0},{nvl=1,tm=2000,new=os.time()}
- effect={0,4}
- mapCode='@Nil'
- nextMap=false
- textarea=ui.addTextArea
- function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,active,active2)
- --if not backgroundColor then backgroundColor=0x324650 end
- --if not borderColor then borderColor=0x000001 end
- if active then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
- end
- if active2 then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- end
- textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
- end
- getRandomData=function()
- local players = {}
- for n,v in pairs(tfm.get.room.playerList) do if not v.isDead then table.insert(players,v) end end
- return players[math.random(#players)]
- end
- function eventNewGame() nextMap = false mapCode = tfm.get.room.currentMap tfm.exec.setGameTime(70) shootCN = os.time() c.x = nil c.y = nil difficulty.nvl = 1 difficulty.tm = 2000 difficulty.new = os.time() end
- ScoreBoard=function(...)
- if ... =='close' then
- for i = 3940,3946 do
- for _,id in pairs({i,6969+i,7979+i}) do ui.removeTextArea(id,nil) end
- end
- elseif ... =='open' then
- local players, positions, names, points = {}, "", "", ""
- for n, v in pairs(tfm.get.room.playerList) do
- if #players < 6 then
- if v.score >= 500 then
- v.score=500
- tfm.exec.setPlayerScore(n,500,false)
- end
- players[#players+1] = {n=n,p=v.score}
- else
- break
- end
- end
- table.sort(players,function(a,b) return a.p>b.p end)
- for k,p in pairs(players) do
- m = k
- if m < 10 then m = '0'..m end
- positions = positions.."<J>"..m..".</J><br><br>"
- names = names.."<V>"..p.n.."</V><br><br>"
- points = points.."<G>"..p.p.."</G><br><br>"
- end
- ui.addTextArea(3940,"",nil,250,50,300,222,0x324650,0x324650,nil,true,true)
- ui.addTextArea(3941,"<p align='center'><font size='14'><N2>ScoreBoard (Top 6)</N2></p></p>",nil,250,51,300,20,0x324650,0x324650,1,true,false,true)
- ui.addTextArea(3942,"<J>##.</J> <V> PlayerName </V> <G>Points</G><br><N2>_________________________________________</N2>",nil,252,90,296,180,0x22333b,0x22333b,1,true,false,false)
- ui.addTextArea(3943,positions,nil,252,120,25,180,0,0,0,true)
- ui.addTextArea(3944,names,nil,280,120,100,180,0,0,0,true)
- ui.addTextArea(3945,points,nil,370,120,40,180,0,0,0,true)
- ui.addTextArea(3946,"<N2><br><br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________<br><br>_________________________________________</N2>",nil,252,90,296,180,0,0,0,true,false,true)
- end
- end
- function eventLoop(t,r)
- if t < 3000 then
- shootCN = os.time();
- end
- if r <= 5000 then
- for i,v in pairs(tfm.get.room.playerList) do if not v.isDead then tfm.exec.giveCheese(i)tfm.exec.playerVictory(i) end end
- end
- if t >= 3000 then
- local a = 0; for i,v in pairs(tfm.get.room.playerList) do if not v.isDead then a=a+1 end end
- if not nextMap and (a == 0 or r <= 5000) then nextMap=true tfm.exec.setGameTime(10) end
- if nextMap and (r <= 10000) then if (r <= 0) then tfm.exec.newGame(maps_[math.random(#maps_)]) ScoreBoard('close') else ScoreBoard('open') end end
- if difficulty.new < os.time()-15000 then
- difficulty.nvl = difficulty.nvl + 1
- difficulty.tm = difficulty.tm - 500
- difficulty.new = os.time();
- end
- if c.x == nil and c.y == nil then
- p = getRandomData();
- if p ~= nil then
- c.x = p.x
- c.y = p.y
- c.dir = math.random(1,9)
- c.mx = (c.dir ~= 3 and math.random(80,180) or math.random(-10,10))
- c.my = (c.dir ~= 3 and math.random(-20,20) or -math.random(80,250))
- c.isFacingRight=p.isFacingRight
- c.angle = (c.dir ~= 3 and (c.isFacingRight and math.random(260,275) or math.random(80,95)) or math.random(175,185))
- if c.angle >= 80 and c.angle <= 95 then c.angle_ = c.angle-180 end
- if c.angle >= 175 and c.angle <= 185 then c.angle_ = c.angle-180 end
- if c.angle >= 260 and c.angle <= 275 then c.angle_ = c.angle-180 end
- --c.angle_ = (c.angle < 0 and -1*(c.angle_) or c.angle)
- else
- c.x = -999
- c.y = -999
- c.mx = 0
- c.my = 0
- c.isFacingRight=false
- end
- end
- if c.x ~= -999 and c.y ~= -999 then
- if shootCN < os.time()-(difficulty.tm/2) then tfm.exec.addShamanObject(0,(c.x+(c.isFacingRight and c.mx or -c.mx))+math.random(-4,4), (c.dir ~= 3 and (c.y+(p.isFacingRight and c.my or -c.my)) or c.y+c.my),c.angle_) end
- for i=1,math.random(2,5) do tfm.exec.displayParticle (effect[math.random(#effect)], (c.x+(c.isFacingRight and c.mx or -c.mx))+math.random(-4,4), (c.y+(p.isFacingRight and c.my or -c.my)), 0, math.random(0.8,2)) end
- if shootCN < os.time()-difficulty.tm then a = (c.dir ~= 3 and tfm.exec.addShamanObject((not c.isDead and 17 or -1),(not c.isDead and (c.isFacingRight and c.x+c.mx or c.x-c.mx) or nil),c.y+c.my,c.angle) or tfm.exec.addShamanObject((not c.isDead and 17 or -1),(not c.isDead and (c.isFacingRight and c.x+c.mx or c.x-c.mx) or nil),c.y+c.my,c.angle)) c.x=nil c.y=nil shootCN = os.time(); end
- end
- end
- ui.setMapName("Auto Survivor <BL>|</BL> <G>"..mapCode.."</G> <BL>|</BL> <N>Difficulty : <V>"..difficulty.nvl.."</V></N>")
- end
- function eventNewPlayer(name)
- tfm.exec.chatMessage("<FC>Este minigame se encontra em fase beta e não está 100% conclúido.</FC>",name)
- end
- for _,v in pairs(tfm.get.room.playerList) do eventNewPlayer(_) if v.score > 0 then tfm.exec.setPlayerScore(_,0,false) end end
- tfm.exec.newGame(maps_[math.random(#maps_)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement