Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAPS = {"@5035550","@5036000","@5038425"}
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.newGame(MAPS[math.random(#MAPS)])
- captured = 0
- X = {}
- Y = {}
- count = {};
- canGo = False
- timing = 0
- function eventNewGame()
- tfm.exec.setUIMapName("<ROSE>[!]<N> Capturem todas as luzes! <P")
- 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 = ""
- for x = #X,1,-1 do
- tfm.exec.displayParticle(9,X[x],Y[x],0,0,0,0,nil)
- 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
- stringe = stringe..string.format("<ROSE>%s <N>: <ROSE>%s <N>| ", player, count[player]["counter"])
- ui.addTextArea(1, stringe, nil, 5, 30, 795, 20, 0x212121, 0xED67EA, 0.6, true)
- end
- if captured == #X then
- for x in pairs(count) do
- for y in pairs(count) do
- if count[x]["counter"] > count[y]["counter"] then
- tfm.exec.setUIMapName(string.format("<ROSE>[!]<N> Todas as luzes foram capturadas! <ROSE>Vencedor: <N>%s <P",x))
- end
- end
- end
- timing = timing+0.5
- if timing/2 == 0 then
- tfm.exec.setUIMapName(string.format("<ROSE>[!]<N> Iniciando novo mapa em %s",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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement