Postado Março 13, 2017 8 anos Bem galera estou querendo que meu first items der ao player uma backpack (isso eu consegui fazer) e dentro dessa backpack tenha 4 bag e dentro de uma dessas bag tenha alguns items. Segue abaixo meu script. Spoiler <?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 = {2050, 2382} } ]]></config> <event type="login" name="FirstItems" event="script"> <![CDATA[ domodlib('firstitems_config') function onLogin(cid) local config = { voc_items = { { -- SORC {2190}, -- wand of vortex {2175}, -- spellbook {8820}, -- mage hat {8819} -- mage robe }, { -- DRUID {2182}, -- snakebite rod {2175}, -- spellbook {8820}, -- mage hat {8819} -- mage robe }, { -- PALADIN {2410}, -- throwing knife {2530}, -- copper shield {2480}, -- legion helmet {2464} -- chain armor }, { -- KNIGHT {2409}, -- serpent sword {2530}, -- copper shield {2480}, -- legion helmet {2464} -- chain armor } }, all_items = { {2468}, -- studded legs {2643} -- leather boots }, extra_items = { {1987, 4}, -- bag {5892}, -- return stone {7618}, -- health potion {7620}, -- mana potion {2789, 15}, -- brown mushroom {2120}, -- rope {5710} --light shovel }, knight_weapons = { {2423}, -- clerical mace {2429} -- barbarian axe } } if getPlayerGroupId(cid) < 3 then if getPlayerStorageValue(cid, storage) == -1 then local common = config.voc_items[getPlayerVocation(cid)] if common ~= nil then for _, v in ipairs(common) do doPlayerAddItem(cid, v[1], v[2] or 1) end end local all = config.all_items if all ~= nil then for _, v in ipairs(all) do doPlayerAddItem(cid, v[1], v[2] or 1) end end local extra = config.extra_items local bp = doPlayerAddItem(cid, 1988, 1) if extra ~= nil then for _, v in ipairs(extra) do doAddContainerItem(bp, v[1], v[2] or 1) end end local weapons = config.knight_weapons if weapons ~= nil then for _, w in ipairs(weapons) do if isKnight(cid) then doAddContainerItem(bp, w[1], w[2] or 1) end end end setPlayerStorageValue(cid, storage, 1) end end return true end ]]></event> </mod> Nunca foi tão fácil jogar Pokémon!
Postado Março 14, 2017 8 anos Minha sujestao~ Substitua seu First Items por este aqui.. <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" enabled="yes"> <description><![CDATA[ Custom Fist Items ]]></description> <config name="firstitems_config"><![CDATA[ config = { storage = 40046, items = {} } ]]></config> <event type="login" name="FirstItems" event="buffer"><![CDATA[ domodlib('firstitems_config') if(getPlayerStorageValue(cid, config.storage) > 0) then return end for _, id in ipairs(config.items) do doPlayerAddItem(cid, id, 1) end -- All Vocation -- BackPack -- Rope -- in Backpack doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 5710, 1) -- Brass Armor -- Body doPlayerAddItem(cid, 2465, 1) -- Steel Helmet -- Head doPlayerAddItem(cid, 2457, 1) -- Bonelord Shield -- Right Hand doPlayerAddItem(cid, 2518, 1) -- Sorcerer (Weapon) -- Hand if isSorcerer(cid) then doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex -- Left Hand doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." seje muito bem vindo. welcome..") -- Druid (Weapon) -- Hand elseif isDruid(cid) then doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod -- Left Hand doPlayerAddItem(cid, 2167, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." seje muito bem vindo. welcome..") -- Paladin - Warrior (Weapon) -- Hand elseif isPaladin(cid) then doPlayerAddItem(cid, 2389, 20) -- Spear -- Left Hand doPlayerAddItem(cid, 2167, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." seje muito bem vindo. welcome..") -- Knight (Weapon) -- Hand elseif isKnight(cid) then doPlayerAddItem(cid, 8602, 1) -- Jagged Sword -- Left Hand doPlayerAddItem(cid, 2168, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." seje muito bem vindo. welcome..") end -- All Vocation -- Brass Legs -- in Feet doPlayerAddItem(cid, 2478, 1) -- Leather Boots -- in Boots doPlayerAddItem(cid, 2643, 1) -- Scarf -- in Necklacke doPlayerAddItem(cid, 2661, 1) -- Platinum Coin -- in Arrows doPlayerAddItem(cid, 2152, 1) -- Health Potion -- in Backpack doPlayerAddItem(cid, 7618, 10) -- Shovel -- in Backpack doPlayerAddItem(cid, 2554, 1) -- Mana Potion -- in Backpack doPlayerAddItem(cid, 7620, 15) -- ITENS -- in Backpack doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 5080, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 9019, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 8188, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 2152, 10) -- Knight (Weapon) -- in Backpack if isKnight(cid) then doPlayerAddItem(cid, 2207, 1) -- sword ring end setPlayerStorageValue(cid, config.storage, 1) ]]></event> </mod> a configuraçao é bem simples; as 4 backpacks e os itens que vao ir dentro delas voce configura nessa parte aqui -- ITENS -- in Backpack doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 5080, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 9019, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 8188, 1) doAddContainerItem(doPlayerAddItem(cid, 1998, 1), 2152, 10) 1998 é o ID da green backpack e ao lado é o ID do item que vai cair dentro dela e quantidade.. espero ter ajudado :DD
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.