Postado Março 6, 2015 10 anos Autor Reiniciou o server? Sim, fechei e reabrir novamente com o outro script.
Postado Março 6, 2015 10 anos Hmm, teste assim, acho que vacilei em um detalhe. local bows = { [7438] = {2352}, -- Arma, Munição [5907] = {8304}, -- Arma, Munição [8851] = {6529}, -- Arma, Munição [5803] = {2547}, -- Arma, Munição } local slot = nil function onTarget(cid, target) if not bows[getPlayerSlotItem(cid, 5).itemid] or not bows[getPlayerSlotItem(cid, 6).itemid] then return true end if bows[getPlayerSlotItem(cid, 5).itemid] then slot = 5 elseif bows[getPlayerSlotItem(cid, 6).itemid] then slot = 6 end local bow = bows[getPlayerSlotItem(cid, slot).itemid] if bow then if (getPlayerSlotItem(cid, 10).itemid == bow[1]) then return true else doPlayerSendCancel(cid, "This ammunition is not for this weapon.") return false end end return true end Boa sorte.
Postado Março 6, 2015 10 anos Autor Hmm, teste assim, acho que vacilei em um detalhe. local bows = { [7438] = {2352}, -- Arma, Munição [5907] = {8304}, -- Arma, Munição [8851] = {6529}, -- Arma, Munição [5803] = {2547}, -- Arma, Munição } local slot = nil function onTarget(cid, target) if not bows[getPlayerSlotItem(cid, 5).itemid] or not bows[getPlayerSlotItem(cid, 6).itemid] then return true end if bows[getPlayerSlotItem(cid, 5).itemid] then slot = 5 elseif bows[getPlayerSlotItem(cid, 6).itemid] then slot = 6 end local bow = bows[getPlayerSlotItem(cid, slot).itemid] if bow then if (getPlayerSlotItem(cid, 10).itemid == bow[1]) then return true else doPlayerSendCancel(cid, "This ammunition is not for this weapon.") return false end end return true end Boa sorte. Agora está funcionando nas duas mãos o.O
Postado Março 6, 2015 10 anos Solução Tente assim: Registre a tag abaixo em creaturescripts.xml: <event type="target" name="Weapons" event="script" value="weapons.lua" /> E o script abaixo, "weapons.lua", configurando a ID da arma com a ID da munição, conforme exemplo. local bows = { [7438] = {2352}, -- Arma, Munição [5907] = {8304}, -- Arma, Munição [8851] = {6529}, -- Arma, Munição [5803] = {2547}, -- Arma, Munição } local slot = nil function onTarget(cid, target) if not bows[getPlayerSlotItem(cid, 5).itemid] and not bows[getPlayerSlotItem(cid, 6).itemid] then return true end if bows[getPlayerSlotItem(cid, 5).itemid] then slot = 5 elseif bows[getPlayerSlotItem(cid, 6).itemid] then slot = 6 end local bow = bows[getPlayerSlotItem(cid, slot).itemid] if bow then if (getPlayerSlotItem(cid, 10).itemid == bow[1]) then return true else doPlayerSendCancel(cid, "This ammunition is not for this weapon.") return false end end return true end Agora em login.lua da pasta creaturescripts/scripts, adicione a tag abaixo junto com as do gênero. registerCreatureEvent(cid, "Weapons") Salve e reinicie o server. Boa sorte. Editado Março 6, 2015 10 anos por Adriano SwaTT (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.