Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableMortCommand(true)
- wonCountDown=1
- scores={0,0,0,0,0,0,0,0}
- maps={7455338}
- powery=320
- powerx=math.random(1600)
- mice=0
- ui.addTextArea(10, "", nil, -432, -822, 3625, 953, 0xff0000, 0x00a2ff, 0.6, true)
- Down=string.byte("S")
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoScore(true)
- data={}
- text={}
- lang={}
- lang.en={credits="Credits</font></font><font face='verdana'><font size='11'>\n\n<N>Programming - Fuzzyfirsdog#0000\n\nModule Idea - Reddeathnick#3204\n\nPowerup Suggestions - Reddeathnick#3204, Seaqueen2003#000, Mugiwaraloffy#9866\n\n<VP>Thank you ^^",credits2="Credits",youCanAttack="You can attack",youCanNotAttack="You can not attack",youCanUsePowerups="You can use powerups",youCanNotUsePowerups="You can not use powerups",attacked="ATTACKED",youAreARunner="You are a runner",youAreADeath="You are a death",help="In #deathrun your goal is to complete a task that is given randomly to you. Runners have to escape from the shamans spawning objects to kill the mice. Killers are to kill the mice without letting any get into to hole. Good luck!",close="Close",help2="Help",superJump="SUPER JUMP",speed="SPEED",deathsWin="Deaths win!",runnersWin="Runners win!"}
- roles={"Death","Runner"}
- death=0
- runner=0
- miceInHole=0
- function setLang(n)
- for n,player in pairs(tfm.get.room.playerList) do
- text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
- end
- end
- function bindMouse()
- for n,player in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(n, 32, true, true)
- system.bindMouse(n, true)
- tfm.exec.bindKeyboard(n, 40, true, true)
- tfm.exec.bindKeyboard(n, Down, true, true)
- end
- end
- bindMouse()
- tfm.exec.newGame(maps[math.random(#maps)])
- names={}
- theRole=1
- currentRole=roles[math.floor(theRole)]
- function changeCurrentRole()
- end
- numbs={1,2}
- for n,player in pairs(tfm.get.room.playerList) do
- changeCurrentRole()
- mice=mice+1
- table.insert(names,n)
- setLang(n)
- data[n]={name=n,role=roles[math.floor(numbs[math.random(#numbs)])],points=0,spawnLimit=-1,ableToShoot=0,ableToShoot2=0}
- ui.addTextArea(0, "<font size='30'><BV>You are a<VP> "..data[n].role, n, 234, 131, 348, 123, 0x636363, 0xa6a6a6, 1, true)
- ui.addTextArea(15, "<VP><a href='event:help'><font size='12'>"..text[n].help2.."</a> | <a href='event:credits'>"..text[n].credits2, n, 10, 30, 264, 26, 0x00aaff, 0x00eeff, 0, true)
- end
- function findRoles(n)
- for n,player in pairs(tfm.get.room.playerList) do
- if data[n].role=="Death" then
- tfm.exec.movePlayer(n,30,30,false,0,0,false)
- tfm.exec.setShaman(n)
- ui.addTextArea(0, "<font size='30'><R>"..text[n].youAreADeath, n, 234, 131, 348, 123, 0x636363, 0xa6a6a6, 1, true)
- elseif data[n].role=="Runner" then
- tfm.exec.movePlayer(n,30,300,false,0,0,false)
- ui.addTextArea(0, "<font size='30'><VP>"..text[n].youAreARunner, n, 234, 131, 348, 123, 0x636363, 0xa6a6a6, 1, true)
- end
- end
- end
- n1=scores[math.floor(1)]
- n2=scores[math.floor(2)]
- n3=scores[math.floor(3)]
- print(n1)
- print(n2)
- print(n3)
- function eventNewPlayer(n)
- mice=mice+1
- data[n]={name=n,role=roles[math.floor(numbs[math.random(#numbs)])],points=0,spawnLimit=-1,ableToShoot=0,ableToShoot2=0}
- setLang(n)
- findRoles(n)
- tfm.exec.respawnPlayer(n)
- ui.addTextArea(15, "<VP><a href='event:help'>"..text[n].help2, n, 10, 30, 264, 26, 0x00aaff, 0x00eeff, 0, true)
- end
- function addToRoleNumber()
- for n,player in pairs(tfm.get.room.playerList) do
- if data[n].role=="Death" then
- death=death+1
- elseif data[n].role=="Runner" then
- runner=runner+1
- end
- findRoles(n)
- end
- end
- tfm.exec.newGame(maps[math.random(#maps)])
- function eventNewGame()
- time=0
- theRole=1
- powerx=math.random(1600)
- runner=0
- death=0
- for n,player in pairs(tfm.get.room.playerList) do
- changeCurrentRole()
- data[n].role=roles[math.floor(numbs[math.random(#numbs)])]
- data[n].ableToShoot=0
- data[n].ableToShoot2=0
- data[n].spawnLimit=-1
- end
- findRoles(n)
- for n,player in pairs(tfm.get.room.playerList) do
- if data[n].role=="Death" then
- death=death+1
- end
- if data[n].role=="Runner" then
- runner=runner+1
- end
- end
- findRoles(n)
- end
- locationx=0
- locationy=0
- objects={54,23,202,90,40}
- function eventMouse(n,x,y)
- system.bindMouse(n,false)
- if data[n].role=="Death" then
- data[n].spawnLimit=2
- ui.addTextArea(2, "<font color='#FF9000'><font size='30'><b>"..n.." "..text[n].attacked, nil, x, y, 425, 100, 0x324650, 0x000000, 0, false)
- locationx=x
- locationy=y
- tfm.exec.addShamanObject(objects[math.random(#objects)],locationx,locationy,0,0,20,false)
- tfm.exec.displayParticle(0,locationx,locationy,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,1,-3,1,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,1,1,3,1,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-1,3,-1,3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,locationx,locationy,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
- end
- end
- time=0
- number1=0
- number2=0
- number3=0
- function eventPlayerGetCheese(n)
- if data[n].role=="Runner" then
- data[n].points=data[n].points+3
- for n,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(133, "<font size='20'><font color='#0ff164'>"..text[n].runnersWin, n, 296, 282, 251, 89, 0xd41717, 0x000000, 0, true)
- time=115
- if data[n].role=="Runner" then
- data[n].points=data[n].points+2
- wonCountDown=-5
- end
- end
- end
- function eventPlayerWon(n,time)
- ui.addTextArea(133, "<font size='20'><font color='#d40000'>"..text[n].deathsWin, n, 296, 282, 251, 89, 0xd41717, 0x000000, 0, true)
- if data[n].role=="Death" then
- for n,player in pairs(tfm.get.room.playerList) do
- wonCountDown=-5
- end
- end
- tfm.exec.newGame(maps[math.random(#maps)])
- print("Runners win!")
- end
- end
- function explosions()
- tfm.exec.displayParticle(0,locationx,locationy,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,1,-3,1,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,1,1,3,1,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-1,3,-1,3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,locationx,locationy,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,locationx,locationy,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.explosion(locationx, locationy, 40, 40, false)
- end
- function canShoot()
- for n,player in pairs(tfm.get.room.playerList) do
- if data[n].spawnLimit<1 and data[n].role=="Death" then
- ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanAttack, n, 270, 23, 240, 36, 0x00a611, 0x338500, 0.6, true)
- end
- if not (data[n].spawnLimit<1) and data[n].role=="Death" then
- ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanNotAttack, n, 270, 23, 240, 36, 0x802c2c, 0x6e0000, 0.6, true)
- end
- if data[n].spawnLimit<1 and data[n].role=="Runner" then
- ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanUsePowerups, n, 270, 23, 240, 36, 0x00a611, 0x338500, 0.6, true)
- end
- if not (data[n].spawnLimit<1) and data[n].role=="Runner" then
- ui.addTextArea(12, "\n<p align='center'>"..text[n].youCanNotUsePowerups, n, 270, 23, 240, 36, 0x802c2c, 0x6e0000, 0.6, true)
- end
- end
- end
- function eventLoop()
- wonCoundown=wonCountDown+0.5
- ui.addTextArea(13, "<font size='20'>"..math.floor(time).." / 120s", nil, 316, 73, 251, 122, 0x324650, 0x000000, 0, true)
- changeCurrentRole()
- canShoot()
- for n,player in pairs(tfm.get.room.playerList) do
- data[n].spawnLimit=data[n].spawnLimit-0.5
- if data[n].spawnLimit==0 then
- ui.removeTextArea(2,n)
- system.bindMouse(n, true)
- ui.removeTextArea(11,n)
- end
- end
- time=time+.5
- if time==120 then
- tfm.exec.newGame(maps[math.random(#maps)])
- print("Deaths win!")
- time=-0.5
- elseif time==0 then
- for n,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(0, "<font size='30'><BV>You are a<VP> "..data[n].role, n, 234, 131, 348, 123, 0x636363, 0xa6a6a6, 1, true)
- findRoles(n)
- end
- elseif time==5 then
- for n,player in pairs(tfm.get.room.playerList) do
- ui.removeTextArea(0,n)
- ui.removeTextArea(2,n)
- system.bindMouse(n, true)
- ui.removeTextArea(133,n)
- end
- if runner==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- if death==0 then
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame(maps[math.random(#maps)])
- time=0
- for n,player in pairs(tfm.get.room.playerList) do
- changeCurrentRole()
- data[n].role=roles[math.floor(numbs[math.random(#numbs)])]
- end
- findRoles(n)
- end
- if runner<1 and not (death<1) then
- tfm.exec.disableAutoShaman(true)
- --deaths win
- wonCountDown=-5
- tfm.exec.newGame(maps[math.random(#maps)])
- for n,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(133, "<font size='20'><font color='#d40000'>"..text[n].deathsWin, n, 296, 282, 251, 89, 0xd41717, 0x000000, 0, true)
- changeCurrentRole()
- data[n].role=roles[math.floor(numbs[math.random(#numbs)])]
- if data[n].role=="Death" then
- data[n].points=data[n].points+3
- table.insert(scores,data[n].points)
- print(n1)
- print(n2)
- print(n3)
- end
- end
- findRoles(n)
- end
- end
- if (runner<1) and death==mice then
- tfm.exec.disableAutoShaman(true)
- wonCountdown=-5
- tfm.exec.newGame(maps[math.random(#maps)])
- for n,player in pairs(tfm.get.room.playerList) do
- changeCurrentRole()
- data[n].role=roles[math.floor(numbs[math.random(#numbs)])]
- time=-1
- end
- end
- end
- function eventKeyboard(n, key, down, x,y)
- if key==32 and data[n].role=="Runner" and data[n].spawnLimit<0 then
- ui.addTextArea(11, "<b><font size='30'><font color='#F0F000'>"..text[n].superJump, n, x-50, y-50, 379, 67, 0x324650, 0x000000, 0, false)
- tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(0,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(0,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
- tfm.exec.displayParticle(2,x,y,1,1,3,1,nil)
- tfm.exec.displayParticle(2,x,y,-1,3,-1,3,nil)
- tfm.exec.displayParticle(2,x,y,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.movePlayer(n,x,y,false,0,-90,false)
- data[n].spawnLimit=2
- tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(10,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(10,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(10,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(10,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
- tfm.exec.displayParticle(10,x,y,1,1,3,1,nil)
- tfm.exec.displayParticle(12,x,y,-1,3,-1,3,nil)
- tfm.exec.displayParticle(12,x,y,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.bindKeyboard(n, 32, false, false)
- tfm.exec.addShamanObject(17,x,y,60,50,-10,true)
- data[n].spawnLimit=2
- data[n].ableToShoot=0
- elseif (key==40 or key==Down) and data[n].role=="Runner" and data[n].spawnLimit<0 then
- ui.addTextArea(11, "<b><font size='30'><font color='#F0F000'>"..text[n].speed, n, x-50, y-50, 379, 67, 0x324650, 0x000000, 0, false)
- tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(2,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(2,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(0,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(0,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
- tfm.exec.displayParticle(2,x,y,1,1,3,1,nil)
- tfm.exec.displayParticle(2,x,y,-1,3,-1,3,nil)
- tfm.exec.displayParticle(2,x,y,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.movePlayer(n,x,y,false,90,0,false)
- data[n].spawnLimit=2
- tfm.exec.displayParticle(0,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(0,locationx,locationy,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(10,locationx,locationy,3,-3,3,-3,nil)
- tfm.exec.displayParticle(10,locationx,locationy,-3,3,-3,3,nil)
- tfm.exec.displayParticle(10,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(10,x,y,0.5,-0.5,0.5,-0.5,nil)
- tfm.exec.displayParticle(2,x,y,1,-3,1,-3,nil)
- tfm.exec.displayParticle(10,x,y,1,1,3,1,nil)
- tfm.exec.displayParticle(12,x,y,-1,3,-1,3,nil)
- tfm.exec.displayParticle(12,x,y,-1,-1,-3,-1,nil)
- tfm.exec.displayParticle(5,x,y,0.5,0.5,0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,-0.5,-0.5,-0.5,nil)
- tfm.exec.displayParticle(5,x,y,-0.5,0.5,-0.5,0.5,nil)
- tfm.exec.displayParticle(5,x,y,0.5,-0.5,0.5,-0.5,nil)
- data[n].spawnLimit=2
- data[n].ableToShoot=0
- end
- end
- function eventTextAreaCallback(id,n,a)
- if a=="close" then
- ui.removeTextArea(18,n)
- ui.removeTextArea(19,n)
- ui.removeTextArea(110,n)
- ui.removeTextArea(25,n)
- elseif a=="help" then
- ui.addTextArea(110, "", n, 498, 165, 266, 217, 0x324650, 0x000000, 1, true)
- ui.addTextArea(18, "<font size='15'>"..text[n].help, n, 504, 172, 254, 179, 0x000000, 0x000000, 1, true)
- ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 504, 338, 254, 36, 0x000000, 0xffffff, 1, true)
- elseif a=="credits" then
- ui.addTextArea(25, "<p align='center'><font size='16'><font face='verdana'><J>"..text[n].credits, n, 504, 142, 254, 194, 0x4f4132, 0x695743, 1, true)
- ui.addTextArea(19, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close, n, 504, 338, 254, 36, 0x4f4132, 0x30291a, 1, true)
- end
- end
- function eventPlayerDied(n)
- if data[n].role=="Runner" then
- runner=runner-1
- print(runner)
- end
- if runner<1 then
- tfm.exec.newGame(maps[math.random(#maps)])
- for n,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(133, "<font size='20'><font color='#d40000'>"..text[n].deathsWin, n, 296, 282, 251, 89, 0xd41717, 0x000000, 0, true)
- end
- wonCountDown=-5
- print("hi")
- end
- if death<1 then
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame(maps[math.random(#maps)])
- time=0
- for n,player in pairs(tfm.get.room.playerList) do
- wonCountdown=-5
- changeCurrentRole()
- data[n].role=roles[math.floor(numbs[math.random(#numbs)])]
- end
- end
- end
- print(death)
- print(runner)
- print(mice)
- function eventPlayerLeft(n)
- mice=mice-1
- if data[n].role=="Runner" then
- runner=runner-1
- elseif data[n].role=="Death" then
- death=death-1
- end
- end
- function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, other)
- print("hi")
- tfm.exec.removeObject(other)
- end
Add Comment
Please, Sign In to add comment