Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- owner = "nobody" -- replace with your username
- interval = 9999999999
- maps = {3107377,305748,1539148,4543602,390649,495880,1463332,1492805,292678,305753,1545834,3175437,2964900,1812056,852617,799141,1794907,2939549,459284,1519483,1794873,811211,306360,489829,479091,3419948,290546,276534,3220945,1754355,281649,390657,311496,295988,802958,2643833}
- function main()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- function eventNewGame()
- interval = 9999999999
- tfm.exec.setGameTime(300)
- end
- function eventLoop(time, remaining)
- interval = interval - 1
- if time>3000 and interval>6 then
- ui.removeTextArea(4)
- local users = {}
- for name,p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- users[#users+1] = name
- end
- end
- spawnCannon(users[math.random(#users)])
- end
- if interval<=5 then
- tfm.exec.setUIMapName("<ROSE>The next map will start in "..interval)
- if interval == 0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- if remaining<=0 then
- ui.addTextArea(4, "<VP><p align='center'><B>CONGRATULATIONS</B>\n\n<CH><i>you beat the CPU!", nil, 290, 22, 180, nil, 0x000001, 0xCA0805, 0.8)
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- end
- function eventPlayerDied(name)
- if playerCount() < 1 then
- interval = 6
- end
- end
- function playerCount()
- local n=0
- for name, player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- print(name)
- n=n+1
- end
- end
- return n
- end
- function spawnCannon(name)
- local px = tfm.get.room.playerList[name].x
- local py = tfm.get.room.playerList[name].y
- local cnnx = math.random()*800
- local cnny = math.random()*400
- if cnny > py then
- cnny = py-math.random(50)-20
- end
- if math.abs(cnnx-px) > 300 then
- cnnx = px + math.random(-50, 50)
- end
- local ang = math.deg(math.atan2(cnny-py, cnnx-px))
- for i=0, math.random(10) do
- tfm.exec.addShamanObject(17, cnnx, cnny, ang-90)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement