Guest User

Untitled

a guest
Nov 7th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAfkDeath(true)
  3. tfm.exec.disableAutoShaman(false)
  4. maps={0,1,2,3,4,5,6,9,11,12,13,15,16,17,18,19,20,24,25}
  5. tfm.exec.newGame(0)
  6. system.disableChatCommandDisplay("help",true)
  7.  
  8. ui.addPopup(1, 0, "Hello, welcome to the Haunted Game! The shaman can control mice by pressing I to jump, J to move left,K to move down , and L to move right! If you are uncomfortable with the 'I' button, you can alternatively press the 'Space' button to jump! Feel free to change maps! Have fun! Type !help for this popup to pop again!", nil, 200,100,400,true)
  9.  
  10. function eventChatCommand(name,message)
  11. if message=="help" then
  12. ui.addPopup(1, 0, "Hello, welcome to the Haunted Game! The shaman can control mice by pressing I to jump, J to move left,K to move down , and L to move right! If you are uncomfortable with the 'I' button, you can alternatively press the 'Space' button to jump! Feel free to change maps! Have fun! Type !help for this popup to pop again!", name, 200,100,400,true)
  13. end
  14. end
  15.  
  16. function eventLoop(time,remaining)
  17. if remaining<=0 then
  18. tfm.exec.newGame(maps[math.random(#maps)])
  19. end
  20. end
  21.  
  22. function eventNewGame()
  23. for name, player in pairs(tfm.get.room.playerList) do
  24.     for keys, k in pairs({73, 74, 75, 76}) do
  25.         if player.isShaman then
  26.         tfm.exec.bindKeyboard(name, k, true, true)
  27.         print(name)
  28.         end
  29.     end
  30. end
  31. end
  32.  
  33. function eventKeyboard(name, key, down, x, y)
  34. for name, player in pairs(tfm.get.room.playerList) do
  35.     if not player.isShaman then
  36.     if key == 73 then
  37.         tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
  38.     elseif key == 32 then
  39.         tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
  40.     elseif key == 75 then
  41.         tfm.exec.movePlayer(name, 0, 0, true, 0, 40, false)
  42.     elseif key == 74 then
  43.         tfm.exec.movePlayer(name, 0, 0, true, -40, 0, false)                
  44.     elseif key == 76 then
  45.         tfm.exec.movePlayer(name, 0, 0, true, 40, 0, false)  
  46.     end    
  47.     end                
  48. end
  49. end
  50.  
  51. function eventPlayerDied()
  52. local i=0
  53. for n,player in pairs(tfm.get.room.playerList) do
  54. if not player.isDead then
  55. i=i+1
  56. end
  57. end
  58. if i==0 then
  59. tfm.exec.newGame(maps[math.random(#maps)])
  60. end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment