Advertisement
Itchyboy

REAL Divine Mode [Semi-Untested]

Mar 20th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.16 KB | None | 0 0
  1. tfm.exec.disableAllShamanSkills(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoNewGame(true)
  4. god={}
  5. power=0
  6. alive={}
  7. sac=0
  8. dead={}
  9. sham={}
  10. function eventNewPlayer(name)
  11. table.insert(alive,name)
  12. alive[name]=false
  13. end
  14. for i,v in ipairs(tfm.get.room.playerList) do eventNewPlayer(i) end
  15. function sacrifice(name)
  16. if alive[name] then
  17. tfm.exec.displayParticle(12,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  18. tfm.exec.killPlayer(name)
  19. if tfm.get.room.playerList[name].isShaman then
  20. power=power+sham[name]
  21. else power=power+1
  22. end
  23. tfm.exec.setScore(name,0)
  24. sac=sac+1
  25. if sac==1 then table.insert(god,name)
  26. end
  27. end
  28. end
  29. function highScore()
  30. local scorer={name="*Souris",score=0}
  31. for n,p in pairs(tfm.get.room.playerList) do
  32. if p.score>=scorer.score then
  33. scorer={name=n,score=p.score}
  34. end
  35. end
  36. return scorer.name
  37. end
  38. function deify()
  39. tfm.exec.killPlayer(god[1])
  40. tfm.exec.setPlayerScore(god[1],0)
  41. tfm.exec.setShaman(highScore())
  42. end
  43. function eventNewGame()
  44. power=0
  45. alive={}
  46. for i,v in ipairs(tfm.get.room.playerList) do table.insert(alive,i) end
  47. table.remove(god,1)
  48. deify()
  49. end
  50. function eventPlayerDied(name)
  51. if name~=god[1] then
  52. table.insert(dead,name)
  53. end
  54. end
  55. function eventSummoningEnd(name)
  56. sham[name]=sham[name]-1
  57. end
  58. function eventChatCommand(name,cmd)
  59. local args={}
  60. for i in cmd:gmatch('%S+') do table.insert(args,i) end
  61. if name==god[1] and args[1]=='god' then
  62. if args[2]=='respawn' and power>=1 and not args[3] then tfm.exec.respawnPlayer(dead[math.random(#dead)]) power=power-1
  63. elseif args[2]=='respawn' and power>=2 and args[3] then tfm.exec.respawnPlayer(args[3]) power=power-2
  64. elseif args[2]=='sham' and power>=6 and args[3] then if not tfm.get.room.playerList[args[3]].isShaman then tfm.exec.setShaman(args[3]) table.insert(sham,args[3]) sham[args[3]]=6 power=power-6 end
  65. end
  66. elseif tfm.get.room.playerList[name].isShaman and args[1]=='sham' then
  67. if args[2]=='sacrifice' then sacrifice(alive[math.random(#alive)])
  68. end
  69. end
  70. end
  71. system.disableChatCommandDisplay('god')
  72. system.disableChatCommandDisplay('sham')
  73. table.insert(god,tfm.get.room.playerList[math.random(#tfm.get.room.playerList)])
  74. tfm.exec.newGame('#0')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement