Advertisement
Guest User

Snowball Fight

a guest
Nov 29th, 2015
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. maps={3107377,305748,1539148,4543602,390649,495880,1463332,1492805,292678,305753,1545834,3175437,2964900,1812056,852617,799141,1794907,2939549,459284,1519483,1794873,811211,306360,489829,479091,3419948,290546,276534,3220945,1754355,281649,390657,311496,295988,802958,2643833}
  2. tfm.exec.disableAutoNewGame(true)
  3. tfm.exec.disableAfkDeath(true)
  4. tfm.exec.disableAutoShaman(true)
  5.  
  6. tfm.exec.newGame(maps[math.random(#maps)])
  7.  
  8.  
  9. function eventChatCommand(name,message)
  10. if message=="skip" then
  11. tfm.exec.setGameTime (0 , true )
  12. end
  13. end
  14.  
  15.  
  16. function eventNewPlayer(name)
  17. for _, k in pairs({40, 83, 32}) do
  18. tfm.exec.bindKeyboard(name, k, true, true)
  19. end
  20. end
  21.  
  22. function eventKeyboard(player, key, down, x, y)
  23. if key==40 or key==83 or key==32 then
  24. if tfm.get.room.playerList[player].isFacingRight==true then
  25. tfm.exec.addShamanObject(34, x+15, y, -20, 20, 0, false)
  26. elseif tfm.get.room.playerList[player].isFacingRight==false then
  27. tfm.exec.addShamanObject(34, x-15, y, -20, -20, 0, false)
  28. end
  29. end
  30. end
  31.  
  32. for name in pairs(tfm.get.room.playerList) do
  33. eventNewPlayer(name)
  34. end
  35.  
  36. tfm.exec.snow()
  37.  
  38. local loopCount = 0
  39. function eventLoop(time,remaining)
  40. if loopCount == 0 then
  41. tfm.exec.snow()
  42. tfm.exec.snow()
  43. end
  44. loopCount = (loopCount + 1) % 100
  45. if remaining<=0 or time<=0 then
  46. tfm.exec.newGame(maps[math.random(#maps)])
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement