Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapList = {"@7577773" }
- round = 0;
- alive = 0;
- rank = 1;
- function main()
- tfm.exec.disableAllShamanSkills (true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name, 0)
- end
- launchGame()
- end
- function launchGame()
- tfm.exec.setGameTime(1)
- tfm.exec.newGame(mapList[math.random(#mapList)])
- end
- function eventChatCommand(name, command)
- if command=='mort' then tfm.exec.killPlayer(name) end
- end
- function eventNewGame()
- tfm.exec.setGameTime(120)
- rank = 1;
- alive = 0;
- for name in pairs(tfm.get.room.playerList) do alive = alive+1 end
- round=round+1
- if round > 10 then
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(name, 0)
- end
- round = 1
- end
- tfm.exec.setUIShamanName("<N><font color='#00C8E2'>Round number : <CH>"..round.."/10")
- end
- function eventLoop(past, left)
- if left<0 then tfm.exec.newGame(mapList[math.random(#mapList)]) end
- end
- function eventPlayerLeft(name)
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- end
- function eventPlayerWon(name)
- tfm.exec.setPlayerScore(name, rank==1 and 4 or rank==2 and 3 or rank==3 and 2 or 1, true)
- rank = rank+1
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- end
- function eventPlayerDied(name)
- alive = alive-1
- if alive == 0 then tfm.exec.setGameTime(0) end
- end
- main()
- function eventNewGame()
- shaman=nil
- for name,player in pairs(tfm.get.room.playerList) do
- if(tfm.get.room.playerList[name].isShaman) then
- shaman=name
- print(shaman.." just stole the cheese! CATCH HER!")
- tfm.exec.giveCheese(shaman)
- end
- end
- if(shaman==nil) then
- print('No shaman found!')
- end
- end
- function eventLoop(ct,cr)
- if(shaman~=nil) and not tfm.get.room.playerList[shaman].isDead then
- local shamanx=tfm.get.room.playerList[shaman].x
- local shamany=tfm.get.room.playerList[shaman].y
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isShaman then
- x=tfm.get.room.playerList[name].x
- y=tfm.get.room.playerList[name].y
- if x>shamanx-30 and x<shamanx+30 and y>shamany-30 and y<shamany+30 then
- tfm.exec.giveCheese(name)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement