Advertisement
Hpassospi

[mini-game] Bufpuf!

Oct 19th, 2014
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. function main()
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoNewGame(true)
  4. tfm.exec.newGame(maps[math.random(#maps)])
  5. end
  6. time={}
  7. maps={0,1,2,3,4,5,6,7,8,9,10}
  8.  
  9. function eventLoop(time,remaining)
  10. if remaining<=0 then
  11. tfm.exec.newGame(maps[math.random(#maps)])
  12. end
  13. end
  14.  
  15. function eventPlayerDied()
  16. local i=0
  17. for n,player in pairs(tfm.get.room.playerList) do
  18. if not player.isDead then
  19. i=i+1
  20. end
  21. end
  22. if i==0 then
  23. tfm.exec.newGame(maps[math.random(#maps)])
  24. end
  25. end
  26. main()
  27.  
  28. function eventNewPlayer(name)
  29. time[name]=os.time()
  30. tfm.exec.bindKeyboard(name,32,true,true)
  31. end
  32.  
  33. for name,player in pairs(tfm.get.room.playerList) do
  34. eventNewPlayer(name)
  35. end
  36.  
  37. function eventKeyboard(p,key,down,x,y)
  38. if key==32 and time[p]<os.time()-1000 then
  39. tfm.exec.addShamanObject(24,x,y)
  40. time[p]=os.time();
  41. end
  42. end
  43.  
  44. function eventNewGame()
  45. tfm.exec.setUIMapName("Bufpuf!")
  46. end
  47. function eventPlayerDied(p)
  48. tfm.exec.respawnPlayer(p)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement