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)
- system.disableChatCommandDisplay("remove",true)
- local t=0
- local n=0
- local s="Welcome to Haunted Game created by Mousetat!\nType !remove to remove this chatbox.\n"
- ui.addPopup(1, 1, "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)
- ui.addTextArea(2, s , nil, 20, 20, 400, 200, nil, nil, 0.5, true)
- function eventPopupAnswer(popupID, playerName, answer)
- if popupID==1 and answer=="no" then
- ui.addPopup(1, 0, "You do not agree with me. So you DIE!\n\n Bye Bye cruel world ^^", playerName, 200,100,400,true)
- tfm.exec.killPlayer(playerName)
- s=s..playerName.." died an unfortunate death because she doesn't agree with me :(\n"
- ui.updateTextArea(2,s,nil)
- elseif popupID==1 and answer=="yes" then
- ui.addPopup(1, 0, "Nice! You agree with me. So you get a cheese as a reward!\n\nYummy! ^^", playerName, 200,100,400,true)
- tfm.exec.giveCheese(playerName)
- s=s..playerName.." got CHEESE because she agrees with me ^^\n"
- ui.updateTextArea(2,s,nil)
- elseif popupID==3 and answer=="yes" then
- ui.addPopup(1,0,"Nice! You agree with me, so you will respawn if you're dead and get Meep function! ^^", playerName, 200,100,400,true)
- tfm.exec.respawnPlayer(playerName)
- tfm.exec.setNameColor(playerName, 0xFFFF00)
- tfm.exec.giveMeep(playerName)
- s=s..playerName.." revived(if dead) and got the MEEP function!\n"
- ui.updateTextArea(2,s,nil)
- elseif popupID==3 and answer=="no" then
- ui.addPopup(1, 0, "You do not agree with me. So you DIE!\n\n Bye Bye cruel world ^^", playerName, 200,100,400,true)
- tfm.exec.killPlayer(playerName)
- s=s..playerName.." died an unfortunate death because she doesn't agree with me :(\n"
- ui.updateTextArea(2,s,nil)
- end
- end
- function eventChatCommand(name,message)
- if message=="help" then
- ui.addPopup(3, 1, "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
- if message=="remove"then
- ui.removeTextArea(2, name)
- 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
- s=s..playerName.." died an unfortunate death :(\n"
- ui.updateTextArea(2,s,nil)
- 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
- s=s..playerName.." got cheese back to hole! SHE WON! ^.^\n"
- ui.updateTextArea(2,s,nil)
- 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