Postado Março 21, 2015 10 anos Boa noite, pode me dizer como faço pra adicionar item de volume para Paladin, como spear na mão dele tem apenas uma, queria colocar umas 5x. firstItems[3] = { 2525, 2399, este é o item que quero colocar 5x 2457, 2647, 2643 } firstItems[4] = pode me da uma ajuda por favor? firstitems.lua
Postado Março 21, 2015 10 anos local firstItems = { [1] = {2190, 1}, -- item_id, count (sorcerer) [2] = {2182, 1}, -- item_id, count (druid) [3] = {2399, 1}, -- item_id, count (paladin) [4] = {2409, 1}, -- item_id, count (knight) [10] = {2525, 2457, 2647, 2643}, -- set all } function onLogin(cid) if getPlayerStorageValue(cid, 30001) < 1 then doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][1], firstItems[getPlayerVocation(cid)][2]) for i = 1, table.maxn(firstItems[10]) do doPlayerAddItem(cid, firstItems[10][i], 1) end local bag = doPlayerAddItem(cid, 5949, 1) doAddContainerItem(bag, 2152, 10) doAddContainerItem(bag, 2399, 10) doAddContainerItem(bag, 5710, 1) doAddContainerItem(bag, 2120, 1) setPlayerStorageValue(cid, 30001, 1) end return true end STYLLER OT 2022
Postado Março 21, 2015 10 anos Solução Troca pelo seu: local firstItems_storage = 30001 local allvoc = { -- Items para todas as vocações. {itemid=2554, inContainer = TRUE}, -- Shovel. {itemid=2120, inContainer = TRUE}, -- Rope. {itemid=7618, count=10, inContainer = TRUE}, -- Health Potions. {itemid=7620, count=10, inContainer = TRUE}, -- Mana Potions. {itemid=2152, count=20, inContainer = TRUE}, -- 10 Platinum Coins. {itemid=2643} -- Leather Boots. } local firstItems = { { -- Sorcerer {itemid=5949, container = TRUE}, -- Beach Backpack --> {itemid=2525}, -- Shield --> {itemid=2457}, -- Helmet --> {itemid=2647}, -- Legs --> {itemid=2463}, -- Armor --> {itemid=2190} -- Weapon --> }, { -- Druid {itemid=5949, container = TRUE}, -- Beach Backpack --> {itemid=2525}, -- Shield --> {itemid=2457}, -- Helmet --> {itemid=2647}, -- Legs --> {itemid=2463}, -- Armor --> {itemid=2182} -- Weapon --> }, { -- Paladin {itemid=5949, container = TRUE}, -- Beach Backpack --> {itemid=2525}, -- Shield --> {itemid=2399, count = 5}, -- Weapon --> {itemid=2457}, -- Helmet --> {itemid=2647}, -- Legs --> {itemid=2463} -- Armor --> }, { -- Knight {itemid=5949, container = TRUE}, -- Beach Backpack --> {itemid=2525}, -- Shield --> {itemid=2457}, -- Helmet --> {itemid=2647}, -- Legs --> {itemid=2463}, -- Armor --> {itemid=2409} -- Weapon --> } } for _, items in ipairs(firstItems) do for _, item in ipairs(allvoc) do table.insert(items, item) end end function onLogin(cid) if getPlayerGroupId(cid) < 2 and getPlayerStorageValue(cid, firstItems_storage) <= 0 then local currvoc = getPlayerVocation(cid) local vocation = 5 > currvoc and currvoc or currvoc - 4 local giveItems = firstItems[vocation] if giveItems then for _, v in ipairs(giveItems) do if v.container == TRUE then backpack = doPlayerAddItem(cid, v.itemid, 1) elseif v.inContainer == TRUE then doAddContainerItem(backpack, v.itemid, v.count or 1) else doPlayerAddItem(cid, v.itemid, v.count or 1) end end end setPlayerStorageValue(cid, firstItems_storage, 1) end return TRUE end Ai é só editar ali na count do paladin. ➥ 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.