Postado Março 11, 2018 7 anos Boa noite, Preciso de uma ajuda, tentei de tudo e não consegui... no meu ot, tem sistema de task onde o player é teleportado para uma sala e mata o boss, porem se ele ficar ali segurando respawn e outro player for parar nessa sala, vai bugar, pois o outro player não vai poder matar o boss.. Eu precisava de um script, acredito eu de StepIn, onde quando ele entrasse na sala, já caia pisando no tile com a action, essa action daria X minutos para ele matar o boss, após vencer esses X minutos, ele seria teleportado para o templo de thais, alguem consegue fazer isso por favor?
Postado Março 11, 2018 7 anos Posta o script em que ele é teletransportado, por gentileza. Tentarei lhe ajudar.
Postado Março 11, 2018 7 anos Autor elseif msgcontains(msg, "report") then for k, v in pairs(tasks) do if getCreatureStorage(cid, v.questStarted) == 1 then if getCreatureStorage(cid, v.questStorage) >= v.killsRequired then for i = 1, table.maxn(v.rewards) do if(v.rewards[i].enable) then if isInArray({"boss", "teleport", 1}, v.rewards[i].type) then doTeleportThing(cid, v.rewards[i].values) elseif isInArray({"exp", "experience", 2}, v.rewards[i].type) then doPlayerAddExperience(cid, v.rewards[i].values) elseif isInArray({"item", 3}, v.rewards[i].type) then doPlayerAddItem(cid, v.rewards[i].values[1], v.rewards[i].values[2]) elseif isInArray({"money", 4}, v.rewards[i].type) then doPlayerAddMoney(cid, v.rewards[i].values) elseif isInArray({"storage", "stor", 5}, v.rewards[i].type) then doCreatureSetStorage(cid, v.rewards[i].values[1], v.rewards[i].values[2]) elseif isInArray({"points", "rank", 2}, v.rewards[i].type) then doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + v.rewards[i].values) else print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. v.rewards[i].type .. ", reward could not be loaded.") end end end local rank = getCreatureStorage(cid, rankStorage) selfSay("Great!... you have finished the task number " .. k .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid) doCreatureSetStorage(cid, v.questStarted, 2) break else if getCreatureStorage(cid, v.questStorage) < 0 then doCreatureSetStorage(cid, v.questStorage, 0) end selfSay("Current " .. getCreatureStorage(cid, v.questStorage) .. " " .. v.raceName .. " killed, you need to kill " .. v.killsRequired .. ".", cid) break end end end end return true end é o script de task, a opção é o boss teleport, mas acho que seria mais facil uma tile com action, do que intervir diretamente no npc..., tipo, o npc teleporta ele para X sqm, eu coloco uma tile com action nesse SQM já dando uma storage ou algo do tipo, para tirar ele da sala em X minutos...
Postado Março 11, 2018 7 anos @alexandrehc acho mais fácil um evento em que X minutos ele vai executar, não acha? O único problema, talvez seria se o player deslogar enquanto o tempo não acabar ou algo parecido, então recomendo que trate isso no mapa colocando zona de não deslogar. elseif msgcontains(msg, "report") then local tempoTeleport = 5 -- em minutos local posTeleport = {x = 100, y = 100, z = 7} -- posicao que o player vai, apos ficar X minutos no boss for k, v in pairs(tasks) do if getCreatureStorage(cid, v.questStarted) == 1 then if getCreatureStorage(cid, v.questStorage) >= v.killsRequired then for i = 1, table.maxn(v.rewards) do if(v.rewards[i].enable) then if isInArray({"boss", "teleport", 1}, v.rewards[i].type) then doTeleportThing(cid, v.rewards[i].values) addEvent(function() if isPlayer(cid) then doTeleportThing(cid,posTeleport) end end, tempoTeleport * 60 * 1000) elseif isInArray({"exp", "experience", 2}, v.rewards[i].type) then doPlayerAddExperience(cid, v.rewards[i].values) elseif isInArray({"item", 3}, v.rewards[i].type) then doPlayerAddItem(cid, v.rewards[i].values[1], v.rewards[i].values[2]) elseif isInArray({"money", 4}, v.rewards[i].type) then doPlayerAddMoney(cid, v.rewards[i].values) elseif isInArray({"storage", "stor", 5}, v.rewards[i].type) then doCreatureSetStorage(cid, v.rewards[i].values[1], v.rewards[i].values[2]) elseif isInArray({"points", "rank", 2}, v.rewards[i].type) then doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + v.rewards[i].values) else print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. v.rewards[i].type .. ", reward could not be loaded.") end end end local rank = getCreatureStorage(cid, rankStorage) selfSay("Great!... you have finished the task number " .. k .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid) doCreatureSetStorage(cid, v.questStarted, 2) break else if getCreatureStorage(cid, v.questStorage) < 0 then doCreatureSetStorage(cid, v.questStorage, 0) end selfSay("Current " .. getCreatureStorage(cid, v.questStorage) .. " " .. v.raceName .. " killed, you need to kill " .. v.killsRequired .. ".", cid) break end end end end return true end Acabou bugando a tabulação no código, mas é só dá uma arrumadinha, :D. Editado Março 11, 2018 7 anos por lordzetros (veja o histórico de edições)
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.