Postado Agosto 31, 2017 7 anos Queria uma script assim Tem que estar em party "OBS: Com quantos player quiser" ai o lider da party vai lá e clica na alavanca e teleporta todos para x local nesse x local eles tem que terminar em 25 minutos a quest se nao todos vao para o DP ao terminar a quest recebe o premio.
Postado Setembro 1, 2017 7 anos Solução Em actions/scripts: Mostrar conteúdo oculto local t = { time = {25, "min"}, new_pos = {x=1,y=1,z=1}, -- posição para onde irá ao usar alavanca area = {{x=1,y=1,z=1},{x=1,y=1,z=1}}, -- canto superior esquerdo, canto inferior direito dp_pos = {x=1,y=1,z=1}, -- posição que serão teleportados quando acabar o tempo premio = {2160, 100} -- id, quantidade } function onUse(cid, item, fromPosition, itemEx, toPosition) local p = getPlayerPosition(cid) if not isInParty(cid) then doPlayerSendCancel(cid, "Only members in party can use the lever.") doSendMagicEffect(p, CONST_ME_POFF) return true end if cid ~= getPlayerParty(cid) then doPlayerSendCancel(cid, "Only party leader can use the lever.") doSendMagicEffect(p, CONST_ME_POFF) return true end local members = getPartyMembers(cid) members[#members + 1] = getPartyLeader(cid) for i = 1, #members do doTeleportThing(members[i], t.new_pos) end doSendMagicEffect(t.new_pos, CONST_ME_TELEPORT) doCreatureSay(cid, "You have " .. t.time[1] .. " " .. t.time[2] .. " to finish the challenge!", TALKTYPE_ORANGE_1) addEvent(function() local players = getPlayersInArea(t.area[1], t.area[2]) if #players > 0 then for i = 1, #players do if isInArray(members, players[i]) then doTeleportThing(players[i], t.dp_pos) doPlayerAddItem(players[i], t.reward[1], t.reward[2]) doPlayerSendTextMessage(players[i], MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have finished the challenge.") end end doSendMagicEffect(t.dp_pos, CONST_ME_TELEPORT) end end, mathtime(t.time)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." 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 Em actions.xml: <action actionid="ACTION_ID_DA_ALAVANCA" script="NOMEDOARQUIVO.lua" />
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.