Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 16/10/2016
- --Last update: 16/10/2016
- --[[ Notes:
- Does:
- Um jogo semelhante ao evento de halloween (sistema de portas)
- ]]--
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAfkDeath()
- toDespawn = {}
- mice = {}
- eventNewPlayer = function(n)
- if not mice[n] then
- mice[n] = {deaths=0,candies=0}
- end
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- eventPlayerDied = function(n)
- mice[n].deaths = mice[n].deaths + 1
- tfm.exec.respawnPlayer(n)
- end
- system.spawnDoor = function()
- ui.addTextArea(0,"",nil,50,120,100,220,-1,0xA536D3,1,true)
- ui.addTextArea(1,"",nil,250,120,100,220,-1,0xA536D3,1,true)
- ui.addTextArea(2,"",nil,450,120,100,220,-1,0xA536D3,1,true)
- ui.addTextArea(3,"",nil,650,122,100,220,-1,0xA536D3,1,true)
- end
- system.door = function(id,c,a)
- ui.addTextArea(id,"",nil,250 + (id-1)*200,120,100,220,c,0xA536D3,a,true)
- end
- system.spawnTimer = function()
- ui.addTextArea(4,"",nil,75,55,50,50,0x550479,0xA536D3,1,true)
- ui.addTextArea(5,"",nil,275,55,50,50,0x550479,0xA536D3,1,true)
- ui.addTextArea(6,"",nil,475,55,50,50,0x550479,0xA536D3,1,true)
- ui.addTextArea(7,"",nil,675,55,50,50,0x550479,0xA536D3,1,true)
- end
- timer,on,timers = 10,false,{10,0,0,-1}
- eventNewGame = function()
- ui.addTextArea(1000,"",nil,-1500,-1500,3000,3000,1,1,.4,true)
- tfm.exec.setGameTime(1e7)
- system.spawnDoor()
- system.spawnTimer()
- end
- eventLoop = function()
- for k,v in next,tfm.get.room.playerList do
- ui.addTextArea(100,"<B><R>"..mice[k].deaths.."\n<PT>"..mice[k].candies,k,5,30,nil,nil,1,1,0,true)
- end
- for k,v in ipairs(toDespawn) do
- if v[1] <= os.time()-5000 then
- tfm.exec.removeObject(v[2])
- table.remove(toDespawn,k)
- end
- end
- timer = timer + .5
- if timer%15 == 0 then
- on = not on
- system.door(timers[4],-1)
- timers[2] = math.random(4,7)
- repeat
- timers[3] = math.random(4,7)
- until timers[2] ~= timers[3]
- end
- if on then
- timers[1] = timers[1] - .5
- local format = "<font size='6'>\n<p align='center'><font size='20'><B><V>"..math.ceil(timers[1])
- ui.updateTextArea(timers[2],format,nil)
- ui.updateTextArea(timers[3],format,nil)
- if timers[1] == 0 then
- on = false
- ui.updateTextArea(timers[2],"",nil)
- ui.updateTextArea(timers[3],"",nil)
- timers[4] = timers[math.random(2,3)] - 4
- timers[1] = 10
- timers[2] = 0
- timers[3] = 0
- local rand = trick[math.random(#trick)];rand()
- end
- else
- local id = timers[4]
- system.door(id,0x380438,.5)
- end
- end
- tfm.exec.newGame(6104453)
- trick = {}
- trick[1] --[[ Ice ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- local x2 = x1 + 110
- for k,v in next,tfm.get.room.playerList do
- if v.x >= x1 and v.x <= x2 then
- tfm.exec.killPlayer(k)
- toDespawn[#toDespawn+1] = {os.time(),tfm.exec.addShamanObject(54,v.x,v.y)}
- end
- end
- for i = 1,20 do
- tfm.exec.displayParticle(0,math.random(x1,x2) + math.random(-i,i),210,math.random(-2,2),math.random(0,3),math.random(-.1,.1))
- end
- end
- trick[2] --[[ Cannon ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- local angle = (timers[4] < 3 and 90 or 270)
- for i = 1,2 do
- tfm.exec.addShamanObject(17,x1,400 - (i * 40),angle)
- end
- end
- trick[3] --[[ Balloons ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- for i = 1,10 do
- toDespawn[#toDespawn+1] = {os.time() + math.random(3000),tfm.exec.addShamanObject(28,x1 + 20 + i*math.random(10),360 - i*math.random(10),0,0,10)}
- end
- end
- trick[4] --[[ Kill ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- local x2 = x1 + 110
- for k,v in next,tfm.get.room.playerList do
- if v.x >= x1 and v.x <= x2 then
- tfm.exec.killPlayer(k)
- end
- end
- for i=1,50 do
- local speed = {-.2,0}
- tfm.exec.displayParticle(2,x1+50+math.sin(i)*80,360-math.cos(i)*10,.1,speed[math.random(#speed)])
- end
- end
- trick[5] --[[ Candie ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- local x2 = x1 + 110
- for k,v in next,tfm.get.room.playerList do
- if v.x >= x1 and v.x <= x2 then
- mice[k].candies = mice[k].candies + 1
- end
- end
- for i = 1,15 do
- local info = {x1 + 50 + math.random(-i,i),250 + math.random(i*2),math.random(-1,1),math.random(-1,1)}
- tfm.exec.displayParticle(9,table.unpack(info))
- tfm.exec.displayParticle(11,table.unpack(info))
- end
- end
- trick[6] --[[ Vampire ]] = function()
- local x1 = 245 + (timers[4]-1)*200
- local x2 = x1 + 110
- for k,v in next,tfm.get.room.playerList do
- if v.x >= x1 and v.x <= x2 then
- tfm.exec.setVampirePlayer(k)
- end
- end
- for i = 1,15 do
- local info = {x1 + 50 + math.random(-i,i),250 + math.random(i*2),math.random(-1,1),math.random(-1,1)}
- tfm.exec.displayParticle(0,table.unpack(info))
- tfm.exec.displayParticle(13,table.unpack(info))
- tfm.exec.displayParticle(0,table.unpack(info))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement