Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAPS = {"@5035550","@5036000","@5038425","@5036100","@5038965","@5047209","@5047211"}
- system.disableChatCommandDisplay("m", true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.newGame(MAPS[math.random(#MAPS)])
- captured = 0
- pX = 0
- X = {}
- Y = {}
- count = {};
- canGo = False
- timing = 0
- timeNext = false
- function eventNewGame()
- timeNext = false
- tfm.exec.chatMessage("<ROSE>[!]<N> Get all lights!")
- X = {}
- Y = {}
- captured = 0
- XML = tfm.get.room.xmlMapInfo.xml
- for xml in tfm.get.room.xmlMapInfo.xml:gmatch("<O[^/]+/>") do
- table.insert(X,xml:match('X="(%d+)"'))
- table.insert(Y,xml:match('Y="(%d+)"'))
- end
- for player in pairs(tfm.get.room.playerList) do
- count[player]={["counter"]=0;}
- end
- canGo = true
- end
- function eventLoop()
- if canGo == true then
- stringe = ""
- pX = pX+0.5
- if pX == 1.5 then
- for x = #X,1,-1 do
- tfm.exec.displayParticle(9,X[x],Y[x],0,0,0,0,nil)
- end
- pX = 0
- end
- for player,name in pairs(tfm.get.room.playerList) do
- for x = #X,1,-1 do
- 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
- for y= 30,1,-1 do
- ids = {0,1,4,9,11}
- tfm.exec.displayParticle(ids[math.random(#ids)],X[x],Y[x],math.random(-5,5),math.random(-5,5),0,true)
- end
- X[x] = 9999
- count[player]["counter"] = count[player]["counter"]+1
- captured = captured+1
- end
- end
- end
- if captured == #X then
- tfm.exec.chatMessage("<ROSE>[!]<N> All lights has been captured! <ROSE>Winner: <N>FAIL")
- captured = 0
- timeNext = true
- end
- if timeNext == true then
- timing = timing+0.5
- if timing == 3 then
- tfm.exec.chatMessage(string.format("<ROSE>[!]<N> Starting new map!",timing))
- end
- if timing == 5 then
- tfm.exec.newGame(MAPS[math.random(#MAPS)])
- timing = 0
- end
- end
- end
- end
- function eventNewPlayer(name)
- count[name]={["counter"]=0;}
- end
- function eventChatCommand(playerName,message)
- if (message:sub(0,1) == "m") then
- if playerName == "Eshkation" then
- tfm.exec.chatMessage(string.format("<ROSE>• [%s] %s",playerName,message:sub(3)))
- end
- end
- if (message:sub(0,3) == "add ") then
- if playerName == "Eshkation" then
- map = message:sub(5)
- table.insert(MAPS,map)
- tfm.exec.chatMessage(string.format("<ROSE> [!] added New map: %s",message:sub(3)))
- end
- end
- end
- function eventPlayerDied(playerName)
- tfm.exec.respawnPlayer(playerName)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement