Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoScore(true)
- transf = {}
- stamina = {}
- angle = {}
- parent = {}
- talked = ""
- par = ""
- function new()
- tfm.exec.newGame(math.random(0, 20), nil)
- end
- function eventLoop(p, r)
- if not(par == "") then
- if transf[par] then
- ui.addTextArea(3, par .. ": " .. talked, nil, ((tfm.get.room.objectList[parent[par]].x - 200) / 1.2) + 200, tfm.get.room.objectList[parent[par]].y, 0, 0, 0x123450, 0x123450, 1, false)
- else
- ui.removeTextArea(3, nil)
- par = ""
- talked = ""
- end
- end
- if r < 0 then
- new()
- end
- for i, v in pairs(tfm.get.room.playerList) do
- if transf[i] then
- stamina[i] = stamina[i] - 0.1
- if stamina[i] < 0.1 then
- eventTextAreaCallback(1, i, 1)
- stamina[i] = 0
- end
- else
- stamina[i] = stamina[i] + 0.05
- end
- if stamina[i] > 1 then
- ui.addTextArea(2, stamina[i], i, 0, 380, 0, 0, 0x123450, 0x123450, 0.9, true)
- else
- ui.addTextArea(2, stamina[i], i, 0, 380, 0, 0, 0x123450, 0xFFCCCC, 0.9, true)
- end
- if transf[i] then
- have = false
- for n, g in pairs(tfm.get.room.objectList) do
- if parent[i] == n then
- have = true
- end
- end
- if not(have) then
- eventTextAreaCallback(1, i, 1)
- end
- end
- end
- end
- function eventNewPlayer(j)
- stamina[j] = 1
- transf[j] = false
- angle[j] = 0
- ui.addTextArea(1, '<a href="event:angle">ângulo a spawnar</a><br/><a href="event:1">caixa pequena</a><br/><a href="event:2">caixa grande</a><br/><a href="event:3">tabua pequena</a><br/><a href="event:4">tabua grande</a><br/><a href="event:6">bola de praia</a><br/><a href="event:7">trampolim</a><br/><a href="event:10">bigorna</a><br/><a href="event:28">balão</a><br/><a href="event:32">runa</a>', jogador, 0, 20, 200, 0, 0x123450, 0x123450, 0.9, true)
- ui.addTextArea(2, "", j, 0, 380, 0, 0, 0x123450, 0x123450, 0.9, true)
- end
- function eventPlayerLeft(j)
- if transf[j] == true then
- tfm.exec.removeObject(parent[j])
- end
- transf[j] = nil
- alive = alive - 1
- end
- function eventPlayerDied(j)
- if not(transf[j]) then
- alive = alive - 1
- if alive < 3 then
- tfm.exec.setGameTime(20, true)
- end
- if alive < 1 then
- new()
- end
- end
- end
- function eventPlayerWon(j)
- alive = alive - 1
- if alive < 3 then
- tfm.exec.setGameTime(20, true)
- end
- if alive < 1 then
- new()
- end
- end
- function eventTextAreaCallback(id, j, c)
- if c == "angle" then
- ui.addPopup(1, 2, "qual é o ângulo?", j, 200, 200, 400, true)
- else
- x = tfm.get.room.playerList[j].x
- y = tfm.get.room.playerList[j].y
- if transf[j] then
- transf[j] = false
- tfm.exec.respawnPlayer(j)
- for z=1, 5 do
- tfm.exec.displayParticle(37, tfm.get.room.objectList[parent[j]].x, tfm.get.room.objectList[parent[j]].y, math.random(-10,10), math.random(-10,10), 0, 0, nil)
- end
- tfm.exec.movePlayer(j, tfm.get.room.objectList[parent[j]].x, tfm.get.room.objectList[parent[j]].y, false, 0, 0, false)
- tfm.exec.removeObject(parent[j])
- else
- if tfm.get.room.playerList[j].isDead == false then
- for z=1, 5 do
- tfm.exec.displayParticle(37, x, y, math.random(-10,10), math.random(-10,10), 0, 0, nil)
- end
- tfm.exec.setPlayerScore(j, 1, true)
- tfm.exec.killPlayer(j)
- parent[j] = tfm.exec.addShamanObject(c, x, y, angle[j], 0, 0, false)
- transf[j] = true
- end
- end
- end
- end
- for i, v in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
- function eventPopupAnswer(id, j, r)
- angle[j] = r
- end
- function eventChatMessage(j, m)
- if transf[j] then
- ui.addTextArea(3, j .. ": " .. m, nil, ((tfm.get.room.objectList[parent[j]].x - 200) / 1.2) + 200, tfm.get.room.objectList[parent[j]].y, 0, 0, 0x123450, 0x123450, 1, false)
- par = j
- talked = m
- end
- end
- function eventNewGame()
- alive = #tfm.get.room.playerList
- for i, v in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- tfm.exec.setPlayerScore(i, 0, false)
- end
- end
- new()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement