Postado Dezembro 22, 2021 3 anos Entao galera, tenho esse script em meu ot. Ele abre normalmente, porem quando o evento termina e o ganhandor ''ganha''. o teleporte nao fecha e nem o player e teleportado para o templo alguem pode adicionar para o teleport fechar e quem estiver la dentro for teleportado para o templo pf ! TFS 0.4 Script: Citar local config = { tempo = 1*60, pos = {x=405, y=155, z=7, stackpos = 253}, tp = {x=167, y=43, z=7}, togo = {x=395, y=147, z=7}, premio = 12681, count = 5, effect = 27 } function onSay(cid, words, param, channel) doBroadcastMessage("The fight for the throne has begun, the last man standing there after "..config.tempo/60 .." minute(s) will be the winner.", 21) doCreateTeleport(1387, config.togo, config.tp) for j= 0,(config.tempo -1) do addEvent(function() doBroadcastMessage("Time left: ".. config.tempo - j .." second(s)", 25) end, (50+(j*1000))) end addEvent(function() if isPlayer(getThingFromPos(config.pos).uid) then doBroadcastMessage("The winner is "..getCreatureName(getThingFromPos(config.pos).uid)..".", 21) doPlayerAddItem(getThingFromPos(config.pos).uid, config.premio, config.count) doSendMagicEffect(config.pos, config.effect) else doBroadcastMessage("We didn't had a winner.. so sad!", 21) end end, 1000*config.tempo) end @xWhiteWolf o script e da sua autoria, teria como da essa força pf !!!??? Editado Dezembro 23, 2021 3 anos por Doidodepeda pq simpq simpq sim (veja o histórico de edições)
Postado Dezembro 23, 2021 3 anos Pelo que entendi é pra teleportar somente o vencedor, se for isso mesmo tai. local config = { tempo = 1*60, pos = {x=405, y=155, z=7, stackpos = 253}, tp = {x=167, y=43, z=7}, togo = {x=395, y=147, z=7}, premio = 12681, count = 5, effect = 27 } function onSay(cid, words, param, channel) doBroadcastMessage("The fight for the throne has begun, the last man standing there after "..config.tempo/60 .." minute(s) will be the winner.", 21) doCreateTeleport(1387, config.togo, config.tp) for j = 0, (config.tempo -1) do addEvent(function() doBroadcastMessage("Time left: ".. config.tempo - j .." second(s)", 25) end, (50+(j*1000))) end addEvent(function() if isPlayer(getThingFromPos(config.pos).uid) then local cid = getThingFromPos(config.pos).uid doBroadcastMessage("The winner is "..getCreatureName(cid)..".", 21) doPlayerAddItem(cid, config.premio, config.count) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(config.pos, config.effect) else doBroadcastMessage("We didn't had a winner.. so sad!", 21) end doRemoveItem(getTileItemById(config.tp, 1387).uid, 1) end, 1000*config.tempo) end
Postado Dezembro 24, 2021 3 anos Autor Em 23/12/2021 em 21:43, WooX disse: Pelo que entendi é pra teleportar somente o vencedor, se for isso mesmo tai. local config = { tempo = 1*60, pos = {x=405, y=155, z=7, stackpos = 253}, tp = {x=167, y=43, z=7}, togo = {x=395, y=147, z=7}, premio = 12681, count = 5, effect = 27 } function onSay(cid, words, param, channel) doBroadcastMessage("The fight for the throne has begun, the last man standing there after "..config.tempo/60 .." minute(s) will be the winner.", 21) doCreateTeleport(1387, config.togo, config.tp) for j = 0, (config.tempo -1) do addEvent(function() doBroadcastMessage("Time left: ".. config.tempo - j .." second(s)", 25) end, (50+(j*1000))) end addEvent(function() if isPlayer(getThingFromPos(config.pos).uid) then local cid = getThingFromPos(config.pos).uid doBroadcastMessage("The winner is "..getCreatureName(cid)..".", 21) doPlayerAddItem(cid, config.premio, config.count) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(config.pos, config.effect) else doBroadcastMessage("We didn't had a winner.. so sad!", 21) end doRemoveItem(getTileItemById(config.tp, 1387).uid, 1) end, 1000*config.tempo) end Tipo... ele ta so teleportando para o templo quem fica na cordenada. (o vencedor) queria que tirasse todos que estivessem dentro da area. Editado Dezembro 24, 2021 3 anos por Doidodepeda EDIT (veja o histórico de edições)
Postado Dezembro 24, 2021 3 anos @Doidodepeda Boa tarde, tenta assim: Altere a variável "area" na config, para a área aonde você quer que os players estejam para serem teleportados. local config = { tempo = 1*60, pos = {x=405, y=155, z=7, stackpos = 253}, area = { { x=100, y=100, z=7 }, { x=100, y=100, z=7 } }, tp = {x=167, y=43, z=7}, togo = {x=395, y=147, z=7}, premio = 12681, count = 5, effect = 27 } function onSay(cid, words, param, channel) doBroadcastMessage("The fight for the throne has begun, the last man standing there after "..config.tempo/60 .." minute(s) will be the winner.", 21) doCreateTeleport(1387, config.togo, config.tp) for j = 0, (config.tempo -1) do addEvent(function() doBroadcastMessage("Time left: ".. config.tempo - j .." second(s)", 25) end, (50+(j*1000))) end addEvent(function() if isPlayer(getThingFromPos(config.pos).uid) then local cid = getThingFromPos(config.pos).uid doBroadcastMessage("The winner is "..getCreatureName(cid)..".", 21) doPlayerAddItem(cid, config.premio, config.count) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(config.pos, config.effect) else doBroadcastMessage("We didn't had a winner.. so sad!", 21) end doRemoveItem(getTileItemById(config.tp, 1387).uid, 1) teleportarJogadoresEmArea() end, 1000*config.tempo) end function teleportarJogadoresEmArea() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x=x, y=y, z=config.area[1].z} local player = getTopCreature(pos).uid if isPlayer(player) then doTeleportThing(player, config.togo) end end end end Créditos: @WooX
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.