Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. tfm.exec.disableAutoShaman()
  2.  
  3. tfm.exec.disableAutoNewGame()
  4.  
  5. maps={"@7478080","@7452634","@7478173"}
  6.  
  7. function toStart()
  8.     local i=0
  9.     for n,p in pairs(tfm.get.room.playerList) do
  10.         if not p.isDead then
  11.             i=i+1
  12.         end
  13.     end
  14.     if i==0 then
  15.         tfm.exec.newGame(maps[math.random(#maps)])
  16.     end
  17. end
  18.  
  19. eventPlayerDied=toStart
  20. eventPlayerWon=toStart
  21.  
  22. function eventLoop(time,remaining)
  23.     if remaining <= 0 then
  24.         tfm.exec.newGame(maps[math.random(#maps)])
  25.     end
  26. end
  27.  
  28. tfm.exec.setUIMapName("Skysnow")
  29.  
  30.  
  31. toDespawn={}
  32.  
  33. function eventNewPlayer(n)
  34.     system.bindKeyboard(n, 3, true, true)
  35. end
  36.  
  37. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  38.  
  39. function eventKeyboard(n,key,down,Px,Py)
  40.     if key == 3 and not tfm.get.room.playerList[n].isDead then
  41.         local id=tfm.exec.addShamanObject(10, Px+(tfm.get.room.playerList[n].isFacingRight and 5 or -10), Py-3, 20, -20, 0)
  42.         table.insert(toDespawn,{os.time(),id})
  43.     end
  44. end
  45.  
  46. function eventLoop()
  47.     for i,cannon in ipairs(toDespawn) do
  48.         if cannon[1] <= os.time()-1500 then
  49.             tfm.exec.removeObject(cannon[2])
  50.             table.remove(toDespawn,i)
  51.         end
  52.     end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement