Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p={}
- tnt = 0
- mapas = {6857760,6859036,6844027,6956808}
- time = os.time();
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- 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 eventNewGame()
- setNewMouse()
- tnt = 20
- passar = os.time();
- vivos = 0
- tfm.exec.setGameTime(300)
- for i in pairs(tfm.get.room.playerList) do
- p[i].life = 100
- ui.addTextArea(1,"",i,6,30,math.floor(p[i].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[i].life.."/100",i,6,30,200,16,0,0,0,true)
- tfm.exec.setPlayerScore(i,p[i].life,false)
- vivos = vivos+1;
- end
- end
- function eventNewPlayer(name)
- p[name]={
- life = 100
- }
- tfm.exec.bindKeyboard(name,32,true)
- tfm.exec.setPlayerScore(name,p[name].life,false)
- ui.addTextArea(0,"",name,6,30,200,16,0x00CD00,0x00CD00,90,true)
- ui.addTextArea(1,"",name,6,30,math.floor(p[name].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[name].life.."/100",name,6,30,200,16,0,0,0,true)
- tfm.exec.chatMessage("• <V>[GAME]</V> <CE>Bem-vindo ao The infected mouse.</CE>",name)
- tfm.exec.chatMessage("• <V>[GAME]</V> <VP>Este minigame está em versão de tests.</VP>",name)
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- end
- function eventChatMessage(name,message)
- local arg = split(message, " ")
- end
- function eventKeyboard(name, key, down, x, y)
- if key == 32 and passar < os.time()-1000 then
- if name == mouse then
- for target, player in pairs(tfm.get.room.playerList) do
- if (target ~= name) and not player.isDead then
- if x >= player.x - 15 and x <= player.x + 15 and y >= player.y - 15 and y <= player.y + 15 then
- setNewMouse(target)
- passar = os.time();
- break
- end
- end
- end
- end
- end
- end
- function eventLoop(t,r)
- if t >= 3000 and time < os.time()-8000 then
- verefy()
- time = os.time();
- end
- tfm.exec.setNameColor(mouse, 0xFFCC00)
- if t >= 3000 and tnt >= 0 then
- ui.addTextArea(5,"<J><B><p align='center'><font size='15'>"..math.floor(tnt/2).."</font></p></J>",name,400,370,40,25,nil,0x6a8495,70,true)
- tnt = tnt-1;
- p[mouse].life = p[mouse].life-1;
- ui.addTextArea(1,"",mouse,6,30,math.floor(p[mouse].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[mouse].life.."/100",mouse,6,30,200,16,0,0,0,true)
- tfm.exec.setPlayerScore(mouse,p[mouse].life,false)
- if p[mouse].life < 1 then
- tfm.exec.killPlayer(mouse)
- end
- end
- if t >= 3000 and tnt == 0 then
- if not tfm.get.room.playerList[mouse].isDead then
- p[mouse].life = p[mouse].life-math.random(5,15)
- ui.addTextArea(1,"",mouse,6,30,math.floor(p[mouse].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[mouse].life.."/100",mouse,6,30,200,16,0,0,0,true)
- tfm.exec.setPlayerScore(mouse,p[mouse].life,false)
- if p[mouse].life < 1 then
- tfm.exec.killPlayer(mouse)
- end
- end
- setNewMouse();
- tnt = 20;
- end
- if mouse ~= "" then
- if p[mouse].life < 1 then
- setNewMouse();
- tnt = 20;
- end
- local particles = {2, 13}
- for i = 1, 3 do
- tfm.exec.displayParticle(particles[math.random(#particles)], tfm.get.room.playerList[mouse].x, tfm.get.room.playerList[mouse].y - math.random(5, 15), math.random(-2, 2), math.random(-2, 2))
- end
- end
- end
- function verefy()
- for i,v in pairs(tfm.get.room.playerList) do
- if p[i].life < 100 and mouse ~= i and not tfm.get.room.playerList[i].isDead then
- p[i].life = p[i].life+math.random(3,8)
- ui.addTextArea(1,"",i,6,30,math.floor(p[i].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[i].life.."/100",i,6,30,200,16,0,0,0,true)
- end
- if p[i].life > 100 then
- p[i].life = 100
- ui.addTextArea(1,"",i,6,30,math.floor(p[i].life*2),16,0x00EE00,0x00CD00,70,true)
- ui.addTextArea(2,"<p align='center'><R>"..p[i].life.."/100",i,6,30,200,16,0,0,0,true)
- end
- tfm.exec.setPlayerScore(i,p[i].life,false)
- end
- end
- function eventPlayerDied(name)
- p[name].life = 0
- ui.addTextArea(1,"",name,6,30,math.floor(p[name].life*2),16,0,0,0,true)
- ui.addTextArea(2,"<p align='center'><font color='#EE2C2C'><font size='18'>☠",name,6,25,200,nil,0,0,0,true)
- tfm.exec.setPlayerScore(name,p[name].life,false)
- p[name].life = 1
- vivos = vivos-1;
- if vivos == 1 then
- for i in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[i].isDead then
- tfm.exec.giveCheese(i)
- tfm.exec.playerVictory(i)
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- end
- end
- end
- function setNewMouse(name)
- jogadores = {}
- for i in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[i].isDead then
- table.insert(jogadores,i)
- tfm.exec.setNameColor(i, 0xFFFFFF)
- end
- end
- if name == nil or name == "" then
- mouse = jogadores[math.random(#jogadores)]
- else
- mouse = name
- end
- tfm.exec.chatMessage("• <V>[GAME]</V> <VP>"..mouse.."</VP> está infectado, cuidado!")
- end
- tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement