Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = "Xorcist"
- local mapString = [[
- @149451
- @150664
- @152260
- @155606
- @155628
- @159932
- ]]
- local maps = {}
- for mapCode in mapString:gmatch("[^\n]+") do
- maps[#maps + 1] = mapCode
- end
- assert(#maps > 0, "There are not maps in the queue!")
- local currentMap = 1
- local canLoadMap = true
- local time = {}
- local respawnTimer = 0
- local death = 0
- eventNewGame = function()
- canLoadMap = false
- for k, v in next, tfm.get.room.playerList do
- if k ~= player then
- tfm.exec.killPlayer(k)
- end
- end
- respawnTimer = 0
- death = 0
- tfm.exec.setGameTime(1e7)
- local xml = tfm.get.room.xmlMapInfo or {}
- ui.setMapName(string.format("<J>%s <BL>- %s <G>| <N>Round : <V>%s <BL>/ <V>%s", tostring(xml.author), tostring(tfm.get.room.currentMap), currentMap, #maps))
- end
- eventLoop = function(currentTime)
- if canLoadMap then
- tfm.exec.newGame(maps[currentMap])
- else
- if respawnTimer > 0 and os.time() > respawnTimer then
- respawnTimer = 0
- tfm.exec.respawnPlayer(player)
- end
- end
- end
- eventPlayerWon = function(n, t)
- time[currentMap] = {tfm.get.room.currentMap, t/100, death}
- if currentMap == #maps then
- local maps, myTime = "", 0
- for k, v in next, time do
- maps = maps .. string.format("<BV>%s <BL>- <VP>%s seconds! <R>[%s deaths]\n", v[1], v[2], v[3])
- myTime = myTime + v[2]
- end
- ui.addTextArea(0, maps .. "\n<J>" .. myTime .. " seconds!", nil, 595, 25, 200, nil, 1, 1, .5, true)
- else
- currentMap = currentMap + 1
- canLoadMap = true
- end
- end
- eventPlayerDied = function(n)
- if n == player then
- respawnTimer = os.time() + 2000
- death = death + 1
- end
- end
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoScore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement