Ir para conteúdo

Featured Replies

Postado

Eu uso um script atual mas ele estava bugando e precisei removê-lo, alguém pode me ajudar com esse script?
Eu preciso de um script que faz o player ganhar items predefinidos a primeira vez que logar no character.
 
 
Eu estava usando esse:

Mas tem um problema: sempre que eu dou logout e volto eu recebo os items iniciais denovo..

  Citar
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
 
    <config name="firstitems_config">
<![CDATA[        config = {
            storage = 30001,
            items = {1988, 1987, 2382, 2120, 2580, 2550, 7385, 2395}
-- 7385 (pokeinfo)
-- 2395 (portfoil)  ok
-- 2382 (pokedex) ok
-- 2550 (order) ok
-- 1987 (bag) ok
-- 1988 (badge case) ok
-- 2120 (rope) ok
-- 2580 (fishing rod) ok
        }
    ]]>
</config>
    <event type="login" name="FirstItems" event="script">
<![CDATA[
        domodlib('firstitems_config')
        function onLogin(cid)
            if getCreatureName(cid) == "Account Manager" then
                doSetCreatureOutfit(cid, {lookType = 655}, -1)
            return true
            end
            if getPlayerStorageValue(cid, config.storage) > 0 then
            return true
            end
            if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid > 0 then
            local bag = getPlayerItemById(cid, false, 1987).uid
doAddContainerItem(bag, 12344, 30)
doAddContainerItem(bag, 2392, 35)
doAddContainerItem(bag, 2160, 1)
doAddContainerItem(bag, 12245, 1)
doAddContainerItem(bag, 27669, 1)
doAddContainerItem(bag, 27670, 1)
            return true
            end
            for _, id in ipairs(config.items) do
                doPlayerAddItem(cid, id, 1)
            end
            local bag = getPlayerItemById(cid, false, 1988).uid
            for i = 12260,12267 do
            doAddContainerItem(bag, i, 1)
            end
            setPlayerStorageValue(cid, config.storage, 1)
            return true
        end
    ]]></event>
</mod>

 

 

Editado por JogadordeDBZ (veja o histórico de edições)

Postado

Ponha isso dentro e modifique os items iniciais e me diga se funciona, também o looktype inicial de homem e mulher, add mesmos items homem e mulher.

 

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
 
    <config name="firstitems_config">
<![CDATA[        config = {
            storage = 30001,
            items = {1988, 1987, 2382, 2120, 2580, 2550, 7385, 2395}
        }
    ]]>
</config>
    <event type="login" name="FirstItems" event="script">
<![CDATA[
        domodlib('firstitems_config')
        function onLogin(cid)

            if(getPlayerStorageValue(cid, config.storage) > 0) then
                return true
            end

            for _, id in ipairs(config.items) do
                doPlayerAddItem(cid, id, 1)
            end
            local bag = getPlayerItemById(cid, false, 1988).uid
            doAddContainerItem(bag, 2310, 1)
            doAddContainerItem(bag, 2307, 1)
            doAddContainerItem(bag, 2308, 1)
            doAddContainerItem(bag, 2309, 1)
            doAddContainerItem(bag, 2311, 1)
            doAddContainerItem(bag, 2312, 1)
            doAddContainerItem(bag, 2313, 1)
            doAddContainerItem(bag, 2314, 1)


            if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
                outfit = {lookType = 160}
                doPlayerAddItem(cid, 2550, 1)
                doPlayerAddItem(cid, 2160, 1)
                doPlayerAddItem(cid, 2147, 10)
                doCreatureChangeOutfit(cid, outfit)
            else
                outfit = {lookType = 159}
                doPlayerAddItem(cid, 2550, 1)
                doPlayerAddItem(cid, 2160, 1)
                doPlayerAddItem(cid, 2147, 10)
                doCreatureChangeOutfit(cid, outfit)
            end

            setPlayerStorageValue(cid, config.storage, 1)
            return true
        end
    ]]></event>
</mod>

Editado por Shyrriro (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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo