• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

First Items

Mudrock

Member
Joined
Jan 25, 2017
Messages
102
Reaction score
19
Location
Minas Gerais - Brazil
Hello, I'm having a problem with my first items, for some reason it does not deliver the adventurer stone when the char goes mainland, but all other items are delivered normally.

PS: It does not point to any errors in the console.

Code:
-- Without Rookgaard
local config = {
    [0] = {
        --club, coat
        items = {{2651, 1}, {2398, 1}},
        --container rope, shovel, red apple
        container = {{2120, 1}, {2674, 5}, {2554, 1}}
    },   
    [1] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, rope, shovel, mana potion
        container = {{2152, 20}, {7620, 5}, {18559, 1}}
    },
    [2] = {
        --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
        items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, rope, shovel, mana potion
        container = {{2152, 20}, {7620, 5}, {18559, 1}}
    },
    [3] = {
        --equipment dwarven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
        items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
        --container platinum coin, rope, shovel, health potion, mana potion
        container = {{2152, 20}, {7618, 5}, {7620, 5}, {18559, 1}}
    },
    [4] = {
        --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
        items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, jagged sword, daramian mace, rope, shovel, health potion, mana potion
        container = {{2152, 20}, {8602, 1}, {2439, 1}, {7618, 5}, {7620, 5}, {18559, 1}}
    }
}

function onLogin(player)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    if player:getLastLoginSaved() ~= 0 then
        return true
    end

    if (player:getSlotItem(CONST_SLOT_LEFT)) then
        return true
    end

    for i = 1, #targetVocation.items do
        player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
    end

    local backpack = player:getVocation():getId() == 0 and player:addItem(1987) or player:addItem(1988)
    if not backpack then
        return true
    end

    for i = 1, #targetVocation.container do
        backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
    end
    return true
end
 
Hello, I'm having a problem with my first items, for some reason it does not deliver the adventurer stone when the char goes mainland, but all other items are delivered normally.

PS: It does not point to any errors in the console.

Code:
-- Without Rookgaard
local config = {
    [0] = {
        --club, coat
        items = {{2651, 1}, {2398, 1}},
        --container rope, shovel, red apple
        container = {{2120, 1}, {2674, 5}, {2554, 1}}
    },  
    [1] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, rope, shovel, mana potion
        container = {{2152, 20}, {7620, 5}, {18559, 1}}
    },
    [2] = {
        --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
        items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, rope, shovel, mana potion
        container = {{2152, 20}, {7620, 5}, {18559, 1}}
    },
    [3] = {
        --equipment dwarven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
        items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
        --container platinum coin, rope, shovel, health potion, mana potion
        container = {{2152, 20}, {7618, 5}, {7620, 5}, {18559, 1}}
    },
    [4] = {
        --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
        items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container platinum coin, jagged sword, daramian mace, rope, shovel, health potion, mana potion
        container = {{2152, 20}, {8602, 1}, {2439, 1}, {7618, 5}, {7620, 5}, {18559, 1}}
    }
}

function onLogin(player)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    if player:getLastLoginSaved() ~= 0 then
        return true
    end

    if (player:getSlotItem(CONST_SLOT_LEFT)) then
        return true
    end

    for i = 1, #targetVocation.items do
        player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
    end

    local backpack = player:getVocation():getId() == 0 and player:addItem(1987) or player:addItem(1988)
    if not backpack then
        return true
    end

    for i = 1, #targetVocation.container do
        backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
    end
    return true
end

Do you get a bag / backpack?
Do you get 20 platinium coins?

If yes on both have you restarted the server since you updated the script? Is that the correct script?
 
Similar problem, the difference that the only vocation that receives the items is the [0] - Rook.

No other receives after speaking with the Oracle.

Same script.
 
how to add newer or more containers to keep the backpack more organized? i have tried several ways
like
Lua:
-- Without Rookgaard
local config = {
    [1] = {
        --equipment
        items = {{2456, 1}, {2656, 1}, {2491, 1}, {2647, 1}, {2195, 1}, {2546, 100}, {2171, 1}},
        container = {{2000, 1}},
        container = {{2120, 1}, {2554, 1}, {2789, 100}, {2167, 1}, {2169, 1}},
        container = {{2006, 7}, {2261, 1}, {2305, 1}, {2293, 1}, {2268, 1}, {2304, 1}, {2273, 1}, {2313, 1}}
    },
    [2] = {
        --equipment
        items = {{2456, 1}, {2656, 1}, {2491, 1}, {2647, 1}, {2195, 1}, {2546, 100}, {2171, 1}},
        container = {{}},
        container = {{2120, 1}, {2554, 1}, {2789, 100}, {2167, 1}, {2169, 1}},
        container = {{2006, 7}, {2261, 1}, {2305, 1}, {2293, 1}, {2268, 1}, {2304, 1}, {2273, 1}, {2313, 1}, {2278, 1}}
    },
    [3] = {
        --equipment
        items = {{2455, 1}, {2656, 1}, {2475, 1}, {2647, 1}, {2195, 1}, {2543, 100}, {2171, 1}},
        container = {{2000, 1}},
        container = {{2120, 1}, {2554, 1}, {2789, 100}, {2167, 1}, {2169, 1}},
        container = {{2006, 7}, {2261, 1}, {2305, 1}, {2293, 1}, {2268, 1}, {2304, 1}, {2273, 1}, {2313, 1}}
    },
    [4] = {
        --equipment
        items = {{2536, 1}, {2407, 1}, {2656, 1}, {2497, 1}, {2647, 1}, {2195, 1}, {2562, 1}, {2171, 1}},
        container = {{2000, 1}},
        container = {{2120, 1}, {2554, 1}, {2789, 100}, {2167, 1}, {2169, 1}},
        container = {{2006, 7}, {2261, 1}, {2305, 1}, {2293, 1}, {2304, 1}, {2273, 1}, {2313, 1}, {2436, 1}, {2432, 1}}
    }
}


function onLogin(player)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    if player:getLastLoginSaved() ~= 0 then
        return true
    end

    if (player:getSlotItem(CONST_SLOT_LEFT)) then
        return true
    end

    for i = 1, #targetVocation.items do
        player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
    end

    local backpack = player:getVocation():getId() == 0 and player:addItem(1987) or player:addItem(1988)
    if not backpack then
        return true
    end

    local bag = player:getVocation():getId() ==0 and player:addItem(3939)
    if backpack then
        return true
    end

    for i = 1, #targetVocation.container do
        backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
        bag:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
    end
    return true
end

can't get it working, please help
 
Back
Top