Postado Fevereiro 6, 2016 9 anos Criei um aqui pra você com várias opções, se der algum problema, avise. Em "Data/actions/scripts", copie e cole um arquivo.lua e renomeie para copyOutfit.lua, apague tudo e cole: local t = { remove = true, -- Remover o item ao usar? [True/False] copyAddons = true, -- Copiar addons ao usar? [True/False] storage = 34005, -- Não altere! exaust = 5, -- Delay para usar novamente em segundos. level = 70, -- Level mínimo para usar. notify = true -- Avisar ao jogador alvo que ele teve sua outfit copiada? } function onUse(cid, item, fromPos, itemEx, toPos) if not isPlayer(itemEx.uid) then return doPlayerSendCancel(cid, 'Você só pode usar em outros jogadores!') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) elseif getPlayerLevel(cid) < t.level then return doPlayerSendCancel(cid, 'Você precisa ser level '.. t.level ..' para copiar outfits.') elseif itemEx.uid == cid then return doPlayerSendCancel(cid, 'Você não pode usar em si mesmo.') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) elseif getPlayerAccess(itemEx.uid) > 3 then return doPlayerSendCancel(cid, 'Você não pode copiar o outfit de membros da staff.') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end if getPlayerStorageValue(cid, t.storage) < os.time() then local o = getCreatureOutfit(itemEx.uid) if t.copyAddons then outfit = {lookType = o.lookType, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet, lookAddons = o.lookAddons} else outfit = {lookType = o.lookType, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet} end doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_RED) doPlayerSendTextMessage(cid, 22, 'Você copiou o outfit do jogador '.. getPlayerName(itemEx.uid) ..'.') if t.notify then doPlayerSendTextMessage(itemEx.uid, 22, 'O jogador '.. getPlayerName(cid) ..' copiou seu outfit.') end setPlayerStorageValue(cid, t.storage, t.exaust + os.time()) else doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return doPlayerSendTextMessage(cid, 22, 'Aguarde '.. getPlayerStorageValue(cid, t.storage) - os.time() ..' segundo(s) para usar novamente!') end if t.remove then doRemoveItem(item.uid, 1) end return true end Em "Data/actions", abra o arquivo actions.xml e adicione: <action itemid="XXXX" script="copyOutfit.lua"/> Em XXXX coloque o ID do item desejado. ➥ Regras | Seções OTServ | Seções BOT
Postado Fevereiro 6, 2016 9 anos Autor man muito obrigado funcionou exatamente como eu queria so tem um probleminha, eu marquei la Remove = True, mas o item nao sai e seria interessante tambem colocar uma condição Premium Alias acho que nao remove pq coloquei item na runa e botei runa pra nao remover no config lua. Editado Fevereiro 6, 2016 9 anos por CoyoteStark (veja o histórico de edições)
Postado Fevereiro 6, 2016 9 anos Solução É que eu coloquei o exemplo errado, você deve colocar true/false em letra minúscula. Adicionei a opção de Premium, troque pelo atual: local t = { remove = true, -- Remover o item ao usar? [true/false] copyAddons = true, -- Copiar addons ao usar? [true/false] storage = 34005, -- Não altere! exaust = 5, -- Delay para usar novamente em segundos. level = 70, -- Level mínimo para usar. notify = true, -- Avisar ao jogador alvo que ele teve sua outfit copiada? [true/false] premium = true -- Só jogadores premium podem utilizar o item? [true/false] } function onUse(cid, item, fromPos, itemEx, toPos) if not isPlayer(itemEx.uid) then return doPlayerSendCancel(cid, 'Você só pode usar em outros jogadores!') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) elseif t.premium and not isPremium(cid) then return doPlayerSendCancel(cid, 'Você não é premium account.') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) elseif getPlayerLevel(cid) < t.level then return doPlayerSendCancel(cid, 'Você precisa ser level '.. t.level ..' para copiar outfits.') elseif itemEx.uid == cid then return doPlayerSendCancel(cid, 'Você não pode usar em si mesmo.') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) elseif getPlayerAccess(itemEx.uid) > 3 then return doPlayerSendCancel(cid, 'Você não pode copiar o outfit de membros da staff.') and doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end if getPlayerStorageValue(cid, t.storage) < os.time() then local o = getCreatureOutfit(itemEx.uid) if t.copyAddons then outfit = {lookType = o.lookType, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet, lookAddons = o.lookAddons} else outfit = {lookType = o.lookType, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet} end doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_RED) doPlayerSendTextMessage(cid, 22, 'Você copiou o outfit do jogador '.. getPlayerName(itemEx.uid) ..'.') if t.notify then doPlayerSendTextMessage(itemEx.uid, 22, 'O jogador '.. getPlayerName(cid) ..' copiou seu outfit.') end setPlayerStorageValue(cid, t.storage, t.exaust + os.time()) else doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return doPlayerSendTextMessage(cid, 22, 'Aguarde '.. getPlayerStorageValue(cid, t.storage) - os.time() ..' segundo(s) para usar novamente!') end if t.remove then doRemoveItem(item.uid, 1) end return true end ➥ Regras | Seções OTServ | Seções BOT
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.