Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(false)
- maps={0,1,2,3,4,5,6,9,11,12,13,15,16,17,18,19,20,24,25}
- tfm.exec.newGame(0)
- system.disableChatCommandDisplay("help",true)
- local t=0
- local n=0
- ui.addPopup(1, 0, "Hello, welcome to the Haunted Game created by Mousetat! \nThe shaman can control mice by pressing I to jump, J to move left, K to move down , and L to move right! \nIn short use IJKL to move. \nIf you are uncomfortable with the 'I' button, you can alternatively press the 'Space' button to jump! \n\nFeel free to change maps! \nHave fun! \n\nType !help for this popup to pop again!", nil, 200,100,400,true)
- function eventChatCommand(name,message)
- if message=="help" then
- ui.addPopup(1, 0, "Hello, welcome to the Haunted Game created by Mousetat! \nThe shaman can control mice by pressing I to jump, J to move left, K to move down , and L to move right! \nIn short use IJKL to move. \nIf you are uncomfortable with the 'I' button, you can alternatively press the 'Space' button to jump! \n\nFeel free to change maps! \nHave fun! \n\nType !help for this popup to pop again!", nil, 200,100,400,true)
- end
- end
- function eventLoop(time,remaining)
- if remaining<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventPlayerDied(playerName)
- n=n-1
- print(n)
- for name, player in pairs(tfm.get.room.playerList) do
- if n==t or n<=0 or playerName==player.isShaman then
- if player.isShaman then
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- end
- end
- function eventPlayerWon(playerName,timeElapsed)
- t=t+1
- print("t: " .. t)
- for name, player in pairs(tfm.get.room.playerList) do
- if n==t then
- if player.isShaman then
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- end
- end
- function eventNewGame()
- n=0
- t=0
- for name, player in pairs(tfm.get.room.playerList) do
- for keys, k in pairs({32, 73, 74, 75, 76}) do
- if player.isShaman then
- tfm.exec.bindKeyboard(name, k, true, true)
- else
- tfm.exec.bindKeyboard(name, k, true, false)
- end
- end
- n=n+1
- end
- n=n-1
- print(n)
- end
- function eventKeyboard(name, key, down, x, y)
- for name, player in pairs(tfm.get.room.playerList) do
- if not player.isShaman then
- if key == 73 then
- tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
- elseif key == 32 then
- tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
- elseif key == 75 then
- tfm.exec.movePlayer(name, 0, 0, true, 0, 40, false)
- elseif key == 74 then
- tfm.exec.movePlayer(name, 0, 0, true, -40, 0, false)
- elseif key == 76 then
- tfm.exec.movePlayer(name, 0, 0, true, 40, 0, false)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement