Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- maps={6946086,6354056,6373101,6947670}
- function eventLoop(time,remaining)
- if remaining<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventPlayerDied()
- local i=0
- for n,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- tfm.exec.respawnPlayer(n)
- end
- end
- if i==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventPlayerWon(name)
- tfm.exec.respawnPlayer(name)
- tfm.exec.chatMessage("<VP>You just completed the level!",name)
- tfm.exec.chatMessage("<VP>Your score: "..tfm.get.room.playerList[name].score,name)
- end
- DOWN3 = string.byte("O")
- DOWN4 = 38
- DOWN1 = 40 --keycode of down arrow
- DOWN2 = string.byte("S") --keycode of S
- for name, player in pairs(tfm.get.room.playerList) do
- system.bindKeyboard(name, DOWN1, true)
- system.bindKeyboard(name, DOWN2, true)
- system.bindKeyboard(name, DOWN4, true)
- system.bindKeyboard(name, DOWN3, true)
- end
- function eventKeyboard(name, keyCode, down, x, y)
- if keyCode == DOWN1 or keyCode == DOWN2 then
- tfm.exec.explosion(x, y + 20, 10, 60, true) -- spark(?) explosion
- tfm.exec.displayParticle(tfm.enum.particle.spirit, x, y + 30) -- spark(?) spirit particle
- elseif keyCode == DOWN3 or keyCode == DOWN4 then
- tfm.exec.explosion(x, y - 20, 10, 60, true) -- spark(?) explosion
- tfm.exec.displayParticle(tfm.enum.particle.spirit, x, y - 30) -- spark(?) spirit particle
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- system.bindMouse(name)
- end
- function pythag(x1,y1,x2,y2)
- return math.sqrt((y2-y1)^2+(x2-x1)^2)
- end
- function eventMouse(n,x,y)
- for n,p in pairs(tfm.get.room.playerList) do
- if pythag(x,y,p.x,p.y) <= 15 then
- tfm.exec.movePlayer(n,100,100,true,0,50,false)
- tfm.exec.addShamanObject(27,x,tfm.get.room.playerList,45,50,-20,false)
- end
- end
- end
- ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",nil,5,175,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",nil,5,195,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",nil,5,215,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",nil,5,235,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",nil,5,155,70,20,0x000001,0x000001,1,true)
- function eventTextAreaCallback(textAreaID, playerName, callback)
- if callback=="example" then
- tfm.exec.setVampirePlayer(playerName)
- elseif callback=="999" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,235,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Commands <a align='center'><font size='20' color='#0000FF'><p'> <J>!maps - Shows the maps that are in the rotation of #Zerogravity. <V>",playerName,180,100,500,200,0x272727,0x000001,1,true)
- elseif callback=="44" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Credits <a align='center'><font size='20' color='#0000FF'><p'> <J>Fuzzyfirsdog - Coding the minigame. <V>Tohpy - Working on BR translate. <VI> Bibsho - Gave ideas for the minigame. <T>Tortuegreen - Showed Fuzzyfirsdog how to use some coding stuff. <CH> Suprodo - Gave ideas for the minigame.",playerName,180,100,500,260,0x272727,0x000001,1,true)
- ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,215,70,20,0x000001,0x000001,1,true)
- elseif callback=="p0" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
- ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(5,"<a href='event:5' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,730,195,70,20,0x000001,0x000001,1,true)
- elseif callback=="59" then
- ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",playerName,730,175,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(2,"<a href='event:p0' align='center'><font size='11' color='#00FF57'><p'>Help</a>",playerName,730,195,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(4,"<a href='event:44' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",playerName,730,215,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(30,"<a href='event:999' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",playerName,730,235,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(31,"<a href='event:69' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,730,155,70,20,0x000001,0x000001,1,true)
- elseif callback=="69" then
- ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",playerName,5,175,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",playerName,5,195,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",playerName,5,215,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",playerName,5,235,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,5,155,70,20,0x000001,0x000001,1,true)
- elseif callback=="99" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,235,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Commands <a align='center'><font size='20' color='#0000FF'><p'> <J>!maps - Shows the maps that are in the rotation of #Zerogravity. !help - Gives you some of the help and then gives you a larger Help button to draw your attention.<V>",playerName,180,100,500,200,0x272727,0x000001,1,true)
- elseif callback=="4" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> Credits <a align='center'><font size='20' color='#0000FF'><p'> <J>Fuzzyfirsdog - Coding the minigame. <V>Tohpy - Working on BR translate. <VI> Bibsho - Gave ideas for the minigame. <T>Tortuegreen - Showed Fuzzyfirsdog how to use some coding stuff. <CH> Suprodo - Gave ideas for the minigame. <BV>Pinyxzyaj- Makes sure that there are no bugs in the game.",playerName,180,100,500,260,0x272727,0x000001,1,true)
- ui.addTextArea(7,"<a href='event:7' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,215,70,20,0x000001,0x000001,1,true)
- elseif callback=="p" then
- ui.addTextArea(1000,"<a align='center'><font size='25' color='#00FF57'><p'> <a align='center'><font size='15' color='#0000FF'><p'> ",playerName,-500,-100,3000,3000,0x000001,0x000001,0.5,true)
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
- ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(5,"<a href='event:5' align='center'><font size='11' color='#00FF57'><p'>Close</a>",playerName,5,195,70,20,0x000001,0x000001,1,true)
- elseif callback=="9" then
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> There are some things that you have the ability to do, for example, you can duck to spawn a spirit. You can also click Vampire to become a Vampire. Clicking O spawns a spark on top of you, rather than under you.",playerName,180,100,500,190,0x272727,0x000001,1,true)
- ui.addTextArea(9,"<a href='event:88' align='center'><font size='11' color='#00FF57'><p'>Back</a>",playerName,300,265,60,20,0x000001,0x000001,1,true)
- elseif callback=="88" then
- ui.addTextArea(3,"<a align='center'><font size='25' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='15' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. In #Zerogravity, you can do some tricks, click next to see! ",playerName,180,100,500,190,0x272727,0x000001,1,true)
- ui.addTextArea(9,"<a href='event:9' align='center'><font size='11' color='#00FF57'><p'>Next</a>",playerName,300,265,60,20,0x000001,0x000001,1,true)
- elseif callback=="5" or callback=="7" then
- ui.removeTextArea(5,playerName)
- ui.removeTextArea(3,playerName)
- ui.removeTextArea(200,playerName)
- ui.removeTextArea(7,playerName)
- ui.removeTextArea(9,playerName)
- ui.removeTextArea(1000,playerName)
- end
- end
- function eventNewGame()
- o=tfm.get.room.xmlMapInfo.mapCode
- a=tfm.get.room.xmlMapInfo.author
- m=tfm.get.room.currentMap.id
- tfm.exec.setUIMapName("<VP>@"..o.." - Creator: "..a)
- if m=="6946086" then
- tfm.exec.setUIMapName("<VP>@"..o.." - Level 1 - Creator: "..a)
- end
- end
- tfm.exec.chatMessage("<ROSE>")
- function eventPlayerDied(name)
- tfm.exec.respawnPlayer(name)
- end
- system.disableChatCommandDisplay("help",true)
- system.disableChatCommandDisplay("maps",true)
- system.disableChatCommandDisplay("x",true)
- function eventChatCommand(m,n)
- if n=="maps" then
- tfm.exec.chatMessage("["..#maps.." Maps]<J> MAPS: <VP>6946086, 6354056, 6373101, 6947670",m)
- elseif n=="help" then
- tfm.exec.chatMessage("<a align='center'><font size='12' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='12' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. Click the highlighted button to see more information.",m)
- ui.addTextArea(200,"<a href='event:p' align='center'><font size='130' color='#00FF57'><p'> Help</a>",m,250,-5,600,600,0x000001,0xFFE300,0,true)
- elseif n=="x" then
- ui.removeTextArea(200)
- end
- end
- function eventNewPlayer(n)
- tfm.exec.respawnPlayer(n)
- system.bindKeyboard(n, DOWN1, true)
- system.bindKeyboard(n, DOWN2, true)
- system.bindKeyboard(n, DOWN4, true)
- system.bindKeyboard(n, DOWN3, true)
- ui.addTextArea(1,"<a href='event:example' align='center'><font size='11' color='#FF0000'><p'>Vampire</a>",n,5,175,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(2,"<a href='event:p' align='center'><font size='11' color='#00FF57'><p'>Help</a>",n,5,195,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(4,"<a href='event:4' align='center'><font size='11' color='#00FF57'><p'>Credits</a>",n,5,215,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(31,"<a href='event:59' align='center'><font size='11' color='#0000FF'><p'>Move Tabs</a>",playerName,5,155,70,20,0x000001,0x000001,1,true)
- ui.addTextArea(30,"<a href='event:99' align='center'><font size='11' color='#00FF57'><p'>Commands</a>",nil,5,235,70,20,0x000001,0x000001,1,true)
- tfm.exec.setUIMapName("<VP>@"..o.." - Creator: "..a)
- end
- tfm.exec.setGameTime(5)
- tfm.exec.setRoomMaxPlayers(10)
- function eventNewGame()
- ui.removeTextArea (0) --Remove textarea when a new round begins
- ui.removeTextArea (992)
- mouseWon = false
- o=tfm.get.room.xmlMapInfo.mapCode
- a=tfm.get.room.xmlMapInfo.author
- m=tfm.get.room.currentMap.id
- tfm.exec.setUIMapName("<J>@"..o.."<VP> - Creator: "..a)
- if m=="6946086" then
- tfm.exec.setUIMapName("<VP>@"..o.." - Level 1 - Creator: "..a)
- tfm.exec.chatMessage("<ROSE>[MAP INFO] <CH>@"..o.."<> - Creator: <J>"..a,name)
- end
- end
- function eventPlayerWon(name)
- if not mouseWon then --This'll trigger only when the first mouse gets in the hole
- ui.addTextArea (992,"<a align='center'><font size='95' color='#E9D504'><a'> ",nil,-400,-405,9000,9000,0x000001,0x000001,0.4,true)
- ui.addTextArea (0,"<a align='center'><font size='95' color='#E9D504'><a'> Bravo "..name.."! ",nil,105,85,790,1000,0x000001,0x000001,0,true)
- mouseWon = true
- tfm.exec.setGameTime(5)
- tfm.exec.chatMessage("<VP>You just completed the level!",name)
- tfm.exec.chatMessage("<VP>Your score: "..tfm.get.room.playerList[name].score,name)
- end
- end
- tfm.exec.chatMessage("<a align='center'><font size='12' color='#00FF57'><p'> #Zerogravity <a align='center'><font size='12' color='#FFD000'><p'> The aim in #Zerogravity is to get through obstacles in no gravity maps. There are many easy maps, and at the same time, many hard maps! The creator of this minigame is Fuzzyfirsdog. Click the highlighted button to see more information.")
Advertisement
Add Comment
Please, Sign In to add comment