Advertisement
Allounett_Deathmatic

Cheese robber! v1.0

Oct 22nd, 2013
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --"Cheese robber!" By Deathmatic & Allounett
  2.  
  3. maps = {"108", "109", "110", "111", "112", "113", "@4406148", "@4412311", "@4412333"}
  4.  
  5. tfm.exec.newGame(maps[math.random(#maps)])
  6. coordShamX = 1000
  7. coordShamY = 1000
  8. currentSham = nil
  9.  
  10. function eventNewGame()
  11.   tfm.exec.disableAutoNewGame(true)
  12.   tfm.exec.disableAllShamanSkills(true)
  13.   coordShamX = 1000
  14.   coordShamY = 1000
  15.   currentSham = nil
  16. end
  17.  
  18. function eventLoop(currentTime, timeRemaining)
  19.   if timeRemaining<=0 then
  20.     tfm.exec.newGame(maps[math.random(#maps)])
  21.   end
  22.  
  23.   for name,player in pairs(tfm.get.room.playerList) do
  24.  
  25.     if timeRemaining<=117000 and player.isShaman then
  26.       coordShamX = tfm.get.room.playerList[name].x
  27.       coordShamY = tfm.get.room.playerList[name].y
  28.       currentSham = name
  29.      
  30.       if not player.hasCheese then
  31.         tfm.exec.giveCheese(name)
  32.       end
  33.     end
  34.  
  35.     if not player.hasCheese and not player.isShaman and timeRemaining<=117000 and tfm.get.room.playerList[name].x<(coordShamX+30) and tfm.get.room.playerList[name].x>(coordShamX-30) and tfm.get.room.playerList[name].y<(coordShamY+30) and tfm.get.room.playerList[name].y>(coordShamY-30) then
  36.       tfm.exec.giveCheese(name)
  37.     end
  38.   end
  39. end
  40.  
  41. function eventPlayerGetCheese(playerName)
  42.   local i=0
  43.  
  44.   i=i+1
  45.  
  46.   if i==11 then
  47.     tfm.exec.killPlayer(currentSham)
  48.     coordShamX = 1000
  49.     coordShamY = 1000
  50.   end
  51. end
  52.  
  53. function eventPlayerDied(playerName)
  54.     local i=0
  55.  
  56.   for _,player in pairs (tfm.get.room.playerList) do
  57.     if not player.isDead then
  58.       i=i+1
  59.     end
  60.   end
  61.  
  62.   if i==0 then
  63.     tfm.exec.newGame(maps[math.random(#maps)])
  64.   end
  65. end
  66.  
  67. function eventPlayerWon(playerName)
  68.   eventPlayerDied(playerName)
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement