Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local map = {'<C><P G="-10,10" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" X="111" L="119" H="10" c="3" Y="386" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="504" L="119" H="10" c="3" Y="369" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="330" L="119" H="10" c="3" Y="398" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="329" L="119" H="10" c="3" Y="323" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="267" L="119" H="10" c="3" Y="177" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="714" L="119" H="10" c="3" Y="328" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="186" L="119" H="10" c="3" Y="262" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="505" L="119" H="10" c="3" Y="189" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="510" L="119" H="10" c="3" Y="280" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" X="725" L="119" H="10" c="3" Y="218" T="0" /></S><D /><O /></Z></C>'}
- local mice = {}
- local ganadores = {}
- local ganadores_name = {}
- local contador_ganadores = 0
- local contador = 0
- local contador_in = 5
- local manzanas = false
- local timer = 7
- function eventLoop()
- contador_in = contador_in - 0.5
- timer = timer + 0.5
- if contador_in > -1 then
- ui.addTextArea(0, "<p align='center'><b><font size='18'>Preparados...Empezamos en <v>"..math.ceil(contador_in).."", nil, 270, 27, 300, 50, 0x003366, 0x000000, 1)
- end
- if contador_in == -1 then
- ui.addTextArea(0, "<p align='center'><b><font size='18'>¡Sobrevive!", nil, 270, 27, 300, 50, 0x003366, 0x000000, 1)
- manzanas_s()
- end
- if manzanas == true then
- tfm.exec.addShamanObject(10, 750, math.random(0,400), 0, -15, 0, false)
- end
- if timer == 5 then
- manzanas = true
- end
- ui.addTextArea(1, "<b><font size='14' color='#000'><p align='center'>Personas que finalizaron el reto.</p><br>"..table.concat(ganadores, "<br>").."", nil, 13, 27, 150, 200, 0x0099ff, 0x000000, 0.5, true)
- end
- function manzanas_s()
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.newGame(map[1])
- tfm.exec.killPlayer(ganadores_name[1])
- tfm.exec.killPlayer(ganadores_name[2])
- tfm.exec.killPlayer(ganadores_name[3])
- end
- function eventPlayerDied(name)
- local jugadores = 0
- for name in pairs(tfm.get.room.playerList) do
- if tfm.get.room.playerList[name].isDead then
- else
- jugadores = jugadores + 1
- end
- end
- if jugadores == 1 then
- ganar()
- end
- end
- function ganar()
- for name in pairs(tfm.get.room.playerList) do
- if tfm.get.room.playerList[name].isDead then
- else
- contador = contador + 1
- table.insert(ganadores, "<n><font color='#000'>"..contador..". "..name.."")
- table.insert(ganadores_name, name)
- contador_ganadores = contador_ganadores + 1
- if contador_ganadores == 3 then
- manzanas = false
- else
- for name in pairs(tfm.get.room.playerList) do
- tfm.exec.killPlayer(name)
- end
- contador_in = 5
- end
- end
- end
- end
- function eventNewGame()
- timer = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement