Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Solutions

  1. zipter98's post in (Resolvido)[Pedido] Arena onde TP é liberado após monstro morrer! was marked as the answer   
    Antes de tudo: caso você já tenha um script que dê início a esta missão (como, por exemplo, uma alavanca), coloque isso em tal script para verificar se o jogador já completou a quest: if getPlayerStorageValue(cid, 90182) > -1 then     return doPlayerSendCancel(cid, "You already completed this quest.") end Se você não souber aonde colocar exatamente, ou não tiver o script que mencionei, avise que eu faço para você. Agora, vamos ao código do teleporte: Tag: <movevent type="StepIn" actionid="xxx" event="script" value="arenatp.lua"/> Troque xxx por um actionid que não esteja em uso no seu servidor. data/movements/scripts, arenatp.lua: local arenas = {     [1] = {                                          --Cada número representa uma room.         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [2] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [3] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [4] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [5] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [6] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.     },     [7] = {         fromPos = {x = x, y = y, z = z},      --Coordenadas da posição superior esquerda da arena.         toPos = {x = x, y = y, z = z},        --Coordenadas da posição inferior direita da arena.         pos = {x = x, y = y, z = z},          --Pra onde o player será teleportado.      }, } local storage = 90181 local monsters = {"monster_name", "monster_name"}        --Configure aqui os monstros que serão ignorados pelo script. function isThereSomeMonster(frompos, topos)     for x = frompos.x, topos.x do         for y = frompos.y, topos.y do             local area = {x = x, y = y, z = frompos.z}             local creature = getTopCreature(area).uid             if creature > 0 and isMonster(creature) then                 if not isInArray(monsters, getCreatureName(creature)) then                     return true                 end             end         end     end     return false end function onStepIn(cid, item, position, fromPosition)     if not isPlayer(cid) then         return true     end     local arena = getPlayerStorageValue(cid, storage) < 1 and 1 or getPlayerStorageValue(cid, storage)     if arenas[arena] then         local _arena = arenas[arena]         if getPlayerStorageValue(cid, 90182) > -1 then             return doPlayerSendCancel(cid, "You already completed this quest.") and doTeleportThing(cid, fromPosition)         elseif isThereSomeMonster(_arena.fromPos, _arena.toPos) then             return doPlayerSendCancel(cid, "Kill all the monsters first.") and doTeleportThing(cid, fromPosition)         else             local msg = "You were teleported to the room "..(arena + 1)..". Good luck!"             local new_value = arena + 1             if not arenas[arena + 1] then                 msg = "You completed all the rooms. Congratulations!"                 new_value = -1                 setPlayerStorageValue(cid, 90182, 1)             end             doTeleportThing(cid, _arena.pos)             doPlayerSendTextMessage(cid, 27, msg)             setPlayerStorageValue(cid, storage, new_value)         end     end     return true end
  2. zipter98's post in (Resolvido)Suporte - Script não funciona e nem apresenta erro was marked as the answer   
    function onKill(cid, target)     if isPlayer(cid) and isPlayer(target) == true then         local heart = doPlayerAddItem(cid, 5943, 1)         doItemSetAttribute(heart, "description", "Killed at " .. getPlayerLevel(target) .. " by " .. getPlayerName(cid) .. ".")         doItemSetAttribute(heart, "name", "the "..getCreatureName(target).."'s heart")     end     return true end
  3. zipter98's post in (Resolvido)Request - Auto bless para low level was marked as the answer   
    local level = x     --Level máximo para receber bless. function onLogin(cid)     if getPlayerLevel(cid) <= level then         for i = 1, 5 do             doPlayerAddBlessing(cid, i)         end         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You got blessed.")     end     return true end PS: Não precisa registrar nada no login.lua, visto que o callback é onLogin.
  4. zipter98's post in (Resolvido)[Pedido] Alavanca que sumona 4 portais was marked as the answer   
    local teleport = {     tpId = 1387,          --ID do teleport,     tpDuration = 5,       --Duração, em minutos.     positions = {         {{x = x, y = y, z = z, stackpos = 1}, {x = x, y = y, z = z}},       --{{onde o tp será criado}, {para onde o tp levará}},         {{x = x, y = y, z = z, stackpos = 1}, {x = x, y = y, z = z}},         {{x = x, y = y, z = z, stackpos = 1}, {x = x, y = y, z = z}},         {{x = x, y = y, z = z, stackpos = 1}, {x = x, y = y, z = z}},     }, } function onUse(cid, item, fromPosition, item2, toPosition)     for i = 1, #teleport.positions do         if getThingFromPos(teleport.positions[i][1]).uid > 0 then             return doPlayerSendCancel(cid, "Os teleports já foram criados.")         end         doCreateTeleport(teleport.tpId, teleport.positions[i][2], teleport.positions[i][1])         addEvent(function()             local items = getThingFromPos(teleport.positions[i][1]).uid             if items > 0 then                 doRemoveItem(items, 1)             end         end, teleport.tpDuration * 60 * 1000)     end     return true end
  5. zipter98's post in (Resolvido)Request - Quest que dá SSA com 100 cargas was marked as the answer   
    E assim?
    local storage = 105977 local itemid, charges = 2197, 100 local msg = "Voce achou um Stone Skin Amulet com 100 cargas."   function onUse(cid, item)     if getPlayerStorageValue(cid, storage) < 1 then         local items = doCreateItemEx(itemid)         doItemSetAttribute(items, 'charges', charges)         doPlayerAddItemEx(cid, items, true)         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg)         setPlayerStorageValue(cid, storage, 1)     else         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja fez esta quest.")         return true     end     return true end Testei aqui, e funcionou perfeitamente.
  6. zipter98's post in (Resolvido)doAreaCombatHealth was marked as the answer   
    local test = createCombatArea{     {1, 1, 1},     {1, 2, 1},     {1, 1, 1} } function onUse(cid, item, frompos, itemEx, topos)      doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, getThingPos(cid), test, -5, -1000, CONST_ME_MAGIC_BLUE)     return true end
  7. zipter98's post in (Resolvido)(ERRO) Event onTime not found was marked as the answer   
    data/globalevents/scripts, CTFMax.lua. Troque:

    function onTimer(interval) por:

    function onTime()
  8. zipter98's post in (Resolvido)Suporte Script - Tps ao matar monstro was marked as the answer   
    Como havia apenas um monstro configurado em tps, imaginei que você queria que o código se aplicasse a apenas um único boss. Por isso, mudei a tabela.

    local teleport = {     tpId = 5023,      --ID do teleporte.     tpTime = 10,      --Tempo de duração do teleporte.     tps = {         {{x = 1134, y = 895, z = 3}, {x = 1135, y = 895, z = 2}},         {{posição onde será criado}, {posição onde levará}},         {{posição onde será criado}, {posição onde levará}},         {{posição onde será criado}, {posição onde levará}},     }, } function onDeath(cid)     doCreatureSay(cid, "The teleport will disappear on "..teleport.tpTime.." seconds.", TALKTYPE_ORANGE_1)     for i = 1, #teleport.tps do         doCreateTeleport(teleport.tpId, teleport.tps[i][2], teleport.tps[i][1])         addEvent(function()             local item = getTileItemById(teleport.tps[i][1], teleport.tpId).uid             if item > 0 then                 doRemoveItem(item, 1)                 doSendMagicEffect(teleport.tps[i][1], CONST_ME_POFF)             end         end, teleport.tpTime * 1000)     end     return true end
  9. zipter98's post in (Resolvido)Script que adciona points was marked as the answer   
    Ué, só usar a função que o Vodkart disponibilizou:
    addPoints(cid, amount) Exemplo de código no qual o jogador loga e ganha 1 ponto:
    function onLogin(cid)     if getCreatureName(cid) ~= "Account Manager" then         if getPlayerStorageValue(cid, 9018) < 1 then             addPoints(cid, 1)             setPlayerStorageValue(cid, 9018, 1)             doPlayerSendTextMessage(cid, 27, "You received one point.")         end     end     return true end Exemplo de código no qual o jogador passa por certo piso e ganha 1 ponto:
    function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end     if getPlayerStorageValue(cid, 9019) < 1 then         addPoints(cid, 1)         setPlayerStorageValue(cid, 9019, 1) doPlayerSendTextMessage(cid, 27, "You received one point.")     end     return true end
  10. zipter98's post in (Resolvido)[Pedido] Teleport automático em tal dia/hora. was marked as the answer   
    data/globalevents/scripts, saturdaytp.lua:
    local configuration = {     day = "Saturday",     to_pos = {x = x, y = y, z = z},    --Para onde o teleport levará.     pos = {x = x, y = y, z = z},       --Onde o teleport será criado.     teleport_id = 1387,                --ID do teleport. } function onTime()     if os.date("%A") == configuration.day then         local item = getTileItemById(configuration.pos, configuration.teleport_id).uid         if item > 0 then             doRemoveItem(item, 1)             broadcastMessage("Castle War foi fechado.", MESSAGE_STATUS_WARNING)         else             doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)             broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING)         end     end     return true end Tags:
    <globalevent name="SaturdayTp" time="18:00" event="script" value="saturdaytp.lua"/> <globalevent name="CloseTp" time="21:00" event="script" value="saturdaytp.lua"/>
  11. zipter98's post in (Resolvido)[DUVIDA] Piso que remove items por slot was marked as the answer   
    function onStepIn(cid, item, fromPosition, itemEx, toPosition)     local storage = 417345     local slot = {1, 4, 7, 6, 5}     if getCreatureStorage(cid, storage) < 0 then         doCreatureSetStorage(cid, storage, 1)         for i = 1, #slot do             local slot_item = getPlayerSlotItem(cid, slot[i]).uid             if slot_item > 0 then                 doRemoveItem(slot_item, 1)             end         end         doSendMagicEffect(getThingPos(cid), 13)     else         doSendMagicEffect(getThingPos(cid), 2)     end     return true end
  12. zipter98's post in (Resolvido)Adicionar mais horarios nesse evento was marked as the answer   
    Muda a lib do sistema pra essa:
    torneio = {     awardTournament = 2160,---- Premio     awardAmount = 10,---- quantia do Premio     playerTemple = {x = 1096, y = 1009, z = 7}, ---- posiçao do Templo     tournamentFight = {x = 909, y = 978, z = 7}, ----- Area (Mapa) do torneio     area = {fromx = 899, fromy = 968, fromz = 7, tox = 919, toy = 989, toz= 7},---- fromx = 899, fromy = 968, fromz = 7 : posiçao superior a esquerda do Mapa do torneio /// tox = 919, toy = 989, toz= 7 : Posiçao inferior direito do Mapa do Torneio     waitPlace = {x = 992, y = 998, z = 7}, ---- Sala de Espera (Coloque No-logout na area)     waitArea = {fromx = 987, fromy = 993, fromz = 7, tox = 997, toy = 1003, toz= 7}, ---- fromx = 899, fromy = 968, fromz = 7 : posiçao superior a esquerda do Mapa Sala de espera /// tox = 919, toy = 989, toz= 7 : Posiçao inferior direito do Mapa sala de espera     horarios = {{"11:30:00", "11:35:00"}, {"horario_que_começa_inscrições", "horário_que_começa_batalha"}, {"horario_que_começa_inscrições", "horário_que_começa_batalha"}},     price = 10000, ------ Custo para se inscrever no torneio }   function getPlayersInArea(area)     local players = {}     for x = area.fromx,area.tox do         for y = area.fromy,area.toy do             for z = area.fromz,area.toz do                 local m = getTopCreature({x=x, y=y, z=z}).uid                 if m ~= 0 and isPlayer(m) then                     table.insert(players, m)                 end             end         end     end     return players end Muda a tag do globalevent pra essa: <globalevent name="TournamentStart" time="11:35" event="script" value="Torneio.lua"/> <globalevent name="TournamentStart2" time="horário_que_começa_batalha" event="script" value="Torneio.lua"/> <globalevent name="TournamentStart3" time="horário_que_começa_batalha" event="script" value="Torneio.lua"/> E assim vai.
    Muda o script do NPC pra esse: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg)     if(not npcHandler:isFocused(cid)) then         return false     end     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid     if msgcontains(msg, 'torneio') or msgcontains(msg, 'enter') then         selfSay('Você quer participar do torneio por ['..torneio.price..'] dollars? [Sim/Yes]', cid)         talkState[talkUser] = 2     elseif talkState[talkUser] == 2 then         if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then             for i = 1, #torneio.horarios do                     if os.date("%X") > torneio.horarios[i][1] and os.date("%X") < torneio.horarios[i][2] then                         if doPlayerRemoveMoney(cid, torneio.price) then                         doTeleportThing(cid, torneio.waitPlace)                         setPlayerStorageValue(cid,130130,1)                         doPlayerSendTextMessage(cid, 21, "Bem-vindo, esta é a sala de espera, você espera aqui enquanto o torneio não começa. hora de início: {"..torneio.horarios[i][2].."}.")                         talkState[talkUser] = 0                         return true                     else                         selfSay('Voce nao Tem Dinheiro ('..torneio.price..').', cid)                         talkState[talkUser] = 0                         return true                     end                 end             end             selfSay('As inscrições para o torneio terminaram. Espere até o próximo.', cid)             talkState[talkUser] = 0             return true         else             selfSay('Voce nao quer participar do Torneio? OK, quando quiser, venha até mim!', cid)             talkState[talkUser] = 0             return true         end     end     return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Se não tiver entendido como adiciona novos horários, só avisar que eu te explico.
  13. zipter98's post in (Resolvido)[PEDIDO] - Action que adciona storage was marked as the answer   
    local storages = {xxx, xxx, xxx}     --Coloque aqui as storages. function onUse(cid, item, fromPosition, item2, toPosition)     for i = 1, #storages do         if getPlayerStorageValue(cid, storages[i]) > -1 then             return doPlayerSendCancel(cid, "You already have the storages.")         end         setPlayerStorageValue(cid, storages[i], 1)     end     doRemoveItem(item.uid, 1)     return true end
  14. zipter98's post in (Resolvido)[PEDIDO] Comando !fly house was marked as the answer   
    Yep.

    function onSay(cid, words)     if not getHouseByPlayerGUID(getPlayerGUID(cid)) then         return doPlayerSendCancel(cid, "You don't have a house.")     elseif getCreatureCondition(cid, CONDITION_INFIGHT) then         return doPlayerSendCancel(cid, "You cannot teleport to your house during a battle.")     elseif not getTileInfo(getThingPos(cid)).protection then         return doPlayerSendCancel(cid, "You aren't in a protection zone.")     else         doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))         doPlayerSendTextMessage(cid, 27, "You teleported to your house.")     end     return true end
  15. zipter98's post in (Resolvido)Modificação pvp system was marked as the answer   
    O intervalo de tempo é em segundos.
    local tab = {     --[kill] = {intervalo_de_tempo, "mensagem"}          [1] = {nil, "FIRST KILL!"},     [2] = {10, "DOUBLE KILL!"}, } function onKill(cid, target)     if isPlayer(cid) and isPlayer(target) then         local storage = getPlayerStorageValue(cid, 9018)         local kills = getPlayerStorageValue(cid, 9019) > -1 and getPlayerStorageValue(cid, 9019) + 1 or 1         setPlayerStorageValue(cid, 9019, kills) setPlayerStorageValue(target, 9019, -1)         if tab[kills] then             if kills > 1 then                 if storage < os.time() then                           setPlayerStorageValue(cid, 9019, -1)                     setPlayerStorageValue(cid, 9018, -1)                     return true                 end                 end             doBroadcastMessage(getCreatureName(cid).. " - "..tab[kills][2], MESSAGE_INFO_DESCR)             if tab[kills + 1] then                 setPlayerStorageValue(cid, 9018, os.time() + tab[kills + 1][1])             end         else                       setPlayerStorageValue(cid, 9019, -1)         end     end     return true end        
  16. zipter98's post in (Resolvido)Erro no Script do NPC! was marked as the answer   
  17. zipter98's post in (Resolvido)Remover pedra ao pizar em pizos. was marked as the answer   
    Não detalhei o script com mensagens ao jogador, efeitos nem nada do tipo. Só fiz o que você pediu mesmo.
    1º código:
    function onStepIn(cid, item, position, fromPosition)     local cfg = {         positions = {             {x = x, y = y, z = z},     --Posições dos jogadores.             {x = x, y = y, z = z},         },         rock_id = xxx,                 --ID da pedra.         rock_position = {x = x, y = y, z = z},    --Posição da pedra.     }     if not isPlayer(cid) then         return true     end     for _, posis in pairs(cfg.positions) do         local creature = getTopCreature(posis).uid         if not isCreature(creature) or not isPlayer(creature) then             return true         end     end     local rock = getTileItemById(cfg.rock_position, cfg.rock_id).uid     if rock > 0 then         doRemoveItem(rock, 1)     end     return true end 2º código:
    function onUse(cid, item, fromPosition, item2, toPosition)     local rock_id = xxx                             --ID da pedra.     local rock_position = {x = x, y = y, z = z}     --Posição da pedra.     local rock = getTileItemById(rock_position, rock_id).uid     if rock > 0 then         doRemoveItem(rock, 1)     end     return true end Suponho que saiba fazer as tags. Caso contrário, informe aqui.
  18. zipter98's post in (Resolvido)[Resolvido] Alavanca que possa usar em um intervalo de tempo was marked as the answer   
    Hm, curioso. Tenta esse:
    ps: se não se importa, eu coloquei pra mostrar os segundos também (acho mais legal e.e). caso você não goste, só avisar que eu retiro.
    function convertTime(time)     local minutes = math.floor(time/60)     local seconds = time - (minutes * 60)            return {minutes, seconds} end function onUse(cid, item, frompos, item2, topos)     local msg = "[Castle of Titans] Você deve aguardar %d minuto%s e %d segundo%s para usar a alavanca."     local gates = {         {x = 470, y = 243, z = 7},     --Posições dos portões.         {x = 471, y = 243, z = 7},     }     local id = 9485    --ID do portão.     if getGlobalStorageValue(91801) > os.time() then         local t = convertTime(getGlobalStorageValue(91801) - os.time())         return doPlayerSendCancel(cid, msg:format(t[1], t[1] > 1 and "s" or "", t[2], t[2] > 1 and "s" or ""))     elseif getPlayerGuildId(cid) < 1 then         return doPlayerSendCancel(cid, "You aren't member of any guild.")     end     for _, b in pairs(gates) do         local gate = getTileItemById(b, id).uid         if gate > 0 then             doRemoveItem(gate, 1)             doSendMagicEffect(b, 2)             addEvent(function()                 doCreateItem(id, 1, b)             end, 5 * 60 * 1000)         else             return doPlayerSendCancel(cid, "Someone already opened the gates.")         end     end     broadcastMessage('Os Portões da ponte the Castle of Titans foram abertos, e se fecharão em 5 minutos', MESSAGE_EVENT_ADVANCE)     addEvent(function()         setGlobalStorageValue(91801, os.time() + 3600)     end, 5 * 60 * 1000)     return true end
  19. zipter98's post in (Resolvido)[PEDIDO] Runa de puxar was marked as the answer   
    Er, sou meio newbie quanto a runas. Como exatamente elas funcionam? São actions? No código delas, é necessário setar o exhaust/remover o item, ou isso já é configurado na tag da mesma? Se puder me explicar (:  (ps: um exemplo de script também seria de grande ajuda)
    Pra todo caso, fiz uma action básica que cumpre seus requisitos. Se quiser, você pode adaptá-la para o formato de um código de runa.
    local function isWalkable(pos, creature, proj, pz)-- by Nord     if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end     if getTopCreature(pos).uid > 0 and creature then return false end     if getTileInfo(pos).protection and pz then return false, true end     local n = not proj and 3 or 2     for i = 0, 255 do         pos.stackpos = i         local tile = getTileThingByPos(pos)         if tile.itemid ~= 0 and not isCreature(tile.uid) then             if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then                 return false             end         end     end     return true end function onUse(cid, item, fromPosition, item2, toPosition)     local effect = xxx    --Efeito.     local exh = xxx       --Exhaust, em segundos.     if isCreature(item2.uid) and not isNpc(item2.uid) then         if getPlayerStorageValue(cid, 1870) > os.time() then             local msg = "Wait %d seconds to use this rune again."             return doPlayerSendCancel(cid, msg:format(getPlayerStorageValue(cid, 1870) - os.time()))         end         local positions = {             [0] = {x = getThingPos(cid).x, y = getThingPos(cid).y - 1, z = getThingPos(cid).z},             [1] = {x = getThingPos(cid).x + 1, y = getThingPos(cid).y, z = getThingPos(cid).z},             [2] = {x = getThingPos(cid).x, y = getThingPos(cid).y + 1, z = getThingPos(cid).z},             [3] = {x = getThingPos(cid).x - 1, y = getThingPos(cid).y, z = getThingPos(cid).z},         }         local lookdir = getCreatureLookDirection(cid)         local newPosition = positions[lookdir]          if not isWalkable(newPosition) then             newPosition = getClosestFreeTile(cid, getThingPos(cid))         end         if newPosition then             doTeleportThing(item2.uid, newPosition)             doSendMagicEffect(newPosition, effect)             doSendMagicEffect(toPosition, effect)             setPlayerStorageValue(cid, 1870, os.time() + exh)         else             return doPlayerSendCancel(cid, "Couldn't execute the rune.")         end     else         return doPlayerSendCancel(cid, "Use this rune only on creatures.")     end     return true end
  20. zipter98's post in (Resolvido)Autoloot poketibia help was marked as the answer   
    Antes de tudo:
    Não deve-se fazer isso em situações em que são checados os items de um container:
    for x=0, (getContainerSize(item.uid)) do Supondo que o container tenha 8 slots, o looping será executado 9 vezes (por começar no 0). Assim, seria verificado um slot que não existe, ocasionando um erro.
    Obs.: Os slots começam a ser contados no 0, e não no 1.
    O correto seria:
    for x=0, getContainerSize(item.uid) - 1 do A propósito, acho mais viável colocar um simples actionid na tag da action, ao invés dos ids das corpses dos pokémons. Aí, num onDeath, bastaria setar este aid na corpse.
     
    @topic
    O problema é o seguinte: ao remover um item da corpse, o seguinte passa a ocupar o slot do que foi removido.
    Por exemplo, na corpse de um Charizard encontra-se, no slot 0, 33 essences of fire, e no slot 1, 1 nail. Com este código de autoloot, ao remover as 33 essences of fire, o nail passa a ocupar o antigo slot das essences of fire (no caso, o slot 0). Assim, na próxima execução do looping, não haverá item algum no slot 1, causando o erro. 
    Há algumas maneiras de corrigir isso. A que lhe recomendo seguir é a seguinte:
    Troque:
    for x=0, (getContainerSize(item.uid)) do local itens = getContainerItem(item.uid, x) --if isInArray(toloot, itens.itemid) then table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) --break --end end por:
    for x=0, getContainerSize(item.uid) - 1 do local itens = getContainerItem(item.uid, 0) --if isInArray(toloot, itens.itemid) then table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) --break --end end
  21. zipter98's post in (Resolvido)Script Do Video (Pharao Helmet) was marked as the answer   
    Todas as configurações foram indicadas no script, basta segui-las corretamente e irá funcionar. 
    Tag:
    <action actionid="xxx" event="script" value="createhelmet.lua"/> Troque xxx pelo actionid que será colocado na alavanca.
    Em data/actions/scripts, crie um arquivo com extensão .lua e coloque o seguinte código, com nome createhelmet:
    function onUse(cid, item, fromPosition, item2, toPosition)     local fromid, toid = id1, id2                   --Em id1, você coloca o id da alavanca virada para um lado. Em id2, o id da alavanca virada para o outro lado.     local alavanca = item.itemid == fromid and toid or fromid     local positions = {         {{x = xxx, y = yyy, z = zzz}, itemid},     --Aqui você coloca, respectivamente, as coordenadas e o ID de seu item correspondente.         {{x = xxx, y = yyy, z = zzz}, itemid},         {{x = xxx, y = yyy, z = zzz}, itemid},         {{x = xxx, y = yyy, z = zzz}, itemid},         {{x = xxx, y = yyy, z = zzz}, itemid},         {{x = xxx, y = yyy, z = zzz}, itemid},         {{x = xxx, y = yyy, z = zzz}, itemid},     }     local helmet = {         position = {x = xxx, y = yyy, z = zzz},    --Aqui você coloca as coordenadas de onde o helmet será criado.         id = itemid,                               --Aqui você coloca o ID do helmet.     }     local effect = 5                               --Aqui você coloca o effect que aparecerá no helmet, ao ser criado.     local dist_effect = 3                          --Distance effect, que vai dos item-materiais ao helmet.     for i = 1, #positions do         local item_pos = getTileItemById(positions[i][1], positions[i][2]).uid         if item_pos < 1 then             return doPlayerSendCancel(cid, "Some item is missing, or you put the item on the wrong place.")         end     end     for i = 1, #positions do         local _item = getTileItemById(positions[i][1], positions[i][2]).uid         if _item > 0 then             doRemoveItem(_item, 1)             doSendDistanceShoot(positions[i][1], helmet.position, dist_effect)         end     end     doSendMagicEffect(helmet.position, effect)     doCreateItem(helmet.id, 1, helmet.position)     doTransformItem(item.uid, alavanca) return true end
  22. zipter98's post in (Resolvido)[ERRO]erro PokeCyan [Editado By Senhor] (2) was marked as the answer   
    Acontece que você não fechou a tabela boost_stones.
    Aqui seu código corrigido:



Informação Importante

Confirmação de Termo