Advertisement
Eshkation-

Untitled

May 15th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. MAPS = {"@5035550","@5036000","@5038425","@5036100","@5038965","@5047209","@5047211"}
  2.  
  3. system.disableChatCommandDisplay("m", true)
  4. tfm.exec.disableAutoShaman(true)
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.newGame(MAPS[math.random(#MAPS)])
  7. captured = 0
  8. pX = 0
  9.  
  10. X = {}
  11. Y = {}
  12. count = {};
  13. canGo = False
  14. timing = 0
  15. timeNext = false
  16.  
  17. function eventNewGame()
  18. timeNext = false
  19. tfm.exec.chatMessage("<ROSE>[!]<N> Get all lights!")
  20. X = {}
  21. Y = {}
  22. captured = 0
  23.  
  24. XML = tfm.get.room.xmlMapInfo.xml
  25. for xml in tfm.get.room.xmlMapInfo.xml:gmatch("<O[^/]+/>") do
  26. table.insert(X,xml:match('X="(%d+)"'))
  27. table.insert(Y,xml:match('Y="(%d+)"'))
  28. end
  29. for player in pairs(tfm.get.room.playerList) do
  30. count[player]={["counter"]=0;}
  31. end
  32. canGo = true
  33. end
  34.  
  35.  
  36. function eventLoop()
  37. if canGo == true then
  38. stringe = ""
  39. pX = pX+0.5
  40. if pX == 1.5 then
  41. for x = #X,1,-1 do
  42. tfm.exec.displayParticle(9,X[x],Y[x],0,0,0,0,nil)
  43. end
  44. pX = 0
  45. end
  46. for player,name in pairs(tfm.get.room.playerList) do
  47. for x = #X,1,-1 do
  48. if tfm.get.room.playerList[player].x < X[x]+30 and tfm.get.room.playerList[player].x > X[x]-30 and tfm.get.room.playerList[player].y < Y[x]+30 and tfm.get.room.playerList[player].y > Y[x]-30 then
  49. for y= 30,1,-1 do
  50. ids = {0,1,4,9,11}
  51. tfm.exec.displayParticle(ids[math.random(#ids)],X[x],Y[x],math.random(-5,5),math.random(-5,5),0,true)
  52. end
  53. X[x] = 9999
  54. count[player]["counter"] = count[player]["counter"]+1
  55. captured = captured+1
  56. end
  57. end
  58. end
  59. if captured == #X then
  60. tfm.exec.chatMessage("<ROSE>[!]<N> All lights has been captured! <ROSE>Winner: <N>FAIL")
  61. captured = 0
  62. timeNext = true
  63. end
  64.  
  65. if timeNext == true then
  66. timing = timing+0.5
  67. if timing == 3 then
  68. tfm.exec.chatMessage(string.format("<ROSE>[!]<N> Starting new map!",timing))
  69. end
  70. if timing == 5 then
  71. tfm.exec.newGame(MAPS[math.random(#MAPS)])
  72. timing = 0
  73. end
  74. end
  75. end
  76. end
  77.  
  78.  
  79. function eventNewPlayer(name)
  80. count[name]={["counter"]=0;}
  81. end
  82.  
  83. function eventChatCommand(playerName,message)
  84. if (message:sub(0,1) == "m") then
  85. if playerName == "Eshkation" then
  86. tfm.exec.chatMessage(string.format("<ROSE>• [%s] %s",playerName,message:sub(3)))
  87. end
  88. end
  89.  
  90. if (message:sub(0,3) == "add ") then
  91. if playerName == "Eshkation" then
  92. map = message:sub(5)
  93. table.insert(MAPS,map)
  94. tfm.exec.chatMessage(string.format("<ROSE> [!] added New map: %s",message:sub(3)))
  95. end
  96. end
  97. end
  98.  
  99.  
  100. function eventPlayerDied(playerName)
  101. tfm.exec.respawnPlayer(playerName)
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement