Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local shaman = ''
- local players = {}
- local cns = {}
- local canspawnobject = true
- for k, v in next, {"AutoNewGame", "AutoShaman", "AfkDeath", "AutoTimeLeft", "AllShamanSkills"} do
- tfm.exec['disable' .. v]()
- end
- tfm.exec.newGame('#10')
- function eventNewGame()
- players = {}
- for k in next, tfm.get.room.playerList do
- players[#players + 1] = k
- end
- if (#players > 1) then
- if (shaman ~= '') then
- local shaman2 = shaman
- repeat
- shaman = players[math.random(#players)]
- until
- shaman ~= shaman2
- else
- shaman = players[math.random(#players)]
- end
- tfm.exec.setShaman(shaman)
- end
- end
- function eventSummoningStart(name, id, x, y, angle)
- if (canspawnobject) then
- if (id == 17 or id == 1701 or id == 1702 or id == 1703 or id == 1704) then
- for i = 1, 2 do
- local id = tfm.exec.addShamanObject(id, x, y, angle)
- cns[#cns + 1] = {id, os.time()}
- end
- elseif (id == 24) then
- for i = 1, 15 do
- for i = 1, 3 do
- tfm.exec.explosion(x, y, 5000000, 150, false)
- end
- end
- end
- end
- end
- function eventLoop(elapsed, remaining)
- local elapsed, remaining = math.floor(elapsed/1000), math.floor(remaining/1000)
- for k, v in ipairs(cns) do
- if (v[2] <= os.time()-2500) then
- tfm.exec.removeObject(v[1])
- table.remove(cns, k)
- end
- end
- if (remaining <= 0) then
- tfm.exec.newGame('#10')
- end
- end
- function eventPlayerDied(name)
- local a = 0
- for k, v in next, tfm.get.room.playerList do
- if (not v.isShaman and not v.isDead) then
- a = a + 1
- end
- end
- if (a == 0) then
- tfm.exec.setGameTime(5, false)
- canspawnobject = false
- end
- if (shaman == name) then
- for k, v in next, tfm.get.room.playerList do
- tfm.exec.giveCheese(k)
- tfm.exec.playerVictory(k)
- end
- tfm.exec.setGameTime(5, false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement