Postado Junho 10, 2019 6 anos @Zazeros esqueci de excluir a linha, desculpa!! function HaveCreatureArena(area, remove, clean) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end if clean ~= false then doCleanTile(pos,false) end end end end local from, to = {x = 1105, y = 1113, z = 7}, {x = 1115, y = 1123, z = 7} local t = { lvl = 100, Time = 15, -- em minutos entrada = { {x = 1045, y = 1014, z = 6}, -- pos players {x = 1045, y = 1015, z = 6} }, saida = { {x = 1110, y = 1122, z = 7}, -- pos para onde eles irão {x = 1110, y = 1123, z = 7} }, monstros = { {{x = 1108, y = 1116, z = 7}, "Orc"}, -- defina pos dos montros e nomes {{x = 1108, y = 1117, z = 7}, "Orc"}, {{x = 1108, y = 1118, z = 7}, "Orc"}, {{x = 1108, y = 1119, z = 7}, "Orc"} } } function VarAnihiPlayer(cid) if not isCreature(cid) then return LUA_ERROR end if isInRange(getPlayerPosition(cid), t.saida[1], t.saida[#t.saida]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end end function getPlayersInArea(fromPos, toPos) local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), fromPos, toPos) then table.insert(players, pid) end end return players end function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} if #getPlayersInArea(t.saida[1], t.saida[#t.saida]) > 0 then doPlayerSendCancel(cid, 'Aguarde, tem jogadores fazendo a quest.') return true end for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true end table.insert(check, x) end HaveCreatureArena({from,to}, true, true) for _, summon in pairs(t.monstros) do doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doSendMagicEffect(t.entrada, CONST_ME_POFF) doTeleportThing(tid, t.saida, false) addEvent(VarAnihiPlayer, t.Time*1000, tid) doSendMagicEffect(t.saida, CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 10, 2019 6 anos Autor @Vodkart Cara, não deu nem um erro no console, mas quando puxa a alavanca, os players não são teleportados, mas os monstros são criados, e depois do tempo,e eles ainda não somem. Ja verifiquei as posições deles e do lugar. Ta tudo certo
Postado Julho 16, 2019 5 anos Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Spoiler Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!Please read the forum rules. Projeto ATS (Naruto)Informações AbaixoFacebookYoutubeDiscord Tutoriais / ConteúdosClique Aqui
Postado Julho 19, 2019 5 anos só agora que vi, erro meu function HaveCreatureArena(area, remove, clean) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end if clean ~= false then doCleanTile(pos,false) end end end end local from, to = {x = 1105, y = 1113, z = 7}, {x = 1115, y = 1123, z = 7} local t = { lvl = 100, Time = 15, -- em minutos entrada = { {x = 1045, y = 1014, z = 6}, -- pos players {x = 1045, y = 1015, z = 6} }, saida = { {x = 1110, y = 1122, z = 7}, -- pos para onde eles irão {x = 1110, y = 1123, z = 7} }, monstros = { {{x = 1108, y = 1116, z = 7}, "Orc"}, -- defina pos dos montros e nomes {{x = 1108, y = 1117, z = 7}, "Orc"}, {{x = 1108, y = 1118, z = 7}, "Orc"}, {{x = 1108, y = 1119, z = 7}, "Orc"} } } function VarAnihiPlayer(cid) if not isCreature(cid) then return LUA_ERROR end if isInRange(getPlayerPosition(cid), from, to) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end end function getPlayersInArea(fromPos, toPos) local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), fromPos, toPos) then table.insert(players, pid) end end return players end function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} if #getPlayersInArea(from, to) > 0 then doPlayerSendCancel(cid, 'Aguarde, tem jogadores fazendo a quest.') return true end for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true end table.insert(check, x) end HaveCreatureArena({from,to}, true, true) for _, summon in pairs(t.monstros) do doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doSendMagicEffect(t.entrada, CONST_ME_POFF) doTeleportThing(tid, t.saida, false) addEvent(VarAnihiPlayer, t.Time*1000, tid) doSendMagicEffect(t.saida, CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end Editado Julho 21, 2019 5 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.