• 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!

1.2 If player skills are X give storage X

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
529
Reaction score
56
Need a code if player have
Magic Level - 80
Fist Fighting - 50
Club Fighting - 60
Sword Fighting - 60
(this is imporant)
Axe Fighting - 70 or Distance Fighting - 70

Shielding - 121
Fishing - 91

he gets storage X
 
Solution
> Wrong board! should be on requests

Ehm, is this maybe what u need? xD ( providing details wouldn't hurt )
Haven't tested, give it a try.

Lua:
local config = {
    mLevel  = 80,
    fist    = 50,
    club    = 60,
    sword   = 60,
    axe     = 70,
    dist    = 70,
    shield  = 121,
    fishing = 91,

    storageKey = 12345
    storageValue = 1
}

function onAdvance(player, skill, oldLevel, newLevel)

    if player:getStorageValue(config.storageKey) then
        return true
    end

    if  player:getMagicLevel() == config.mLevel
    and player:getSkillLevel(SKILL_FIST)  == config.fist
    and player:getSkillLevel(SKILL_CLUB)  == config.club
    and player:getSkillLevel(SKILL_SWORD) == config.sword
    and (...
> Wrong board! should be on requests

Ehm, is this maybe what u need? xD ( providing details wouldn't hurt )
Haven't tested, give it a try.

Lua:
local config = {
    mLevel  = 80,
    fist    = 50,
    club    = 60,
    sword   = 60,
    axe     = 70,
    dist    = 70,
    shield  = 121,
    fishing = 91,

    storageKey = 12345
    storageValue = 1
}

function onAdvance(player, skill, oldLevel, newLevel)

    if player:getStorageValue(config.storageKey) then
        return true
    end

    if  player:getMagicLevel() == config.mLevel
    and player:getSkillLevel(SKILL_FIST)  == config.fist
    and player:getSkillLevel(SKILL_CLUB)  == config.club
    and player:getSkillLevel(SKILL_SWORD) == config.sword
    and (
        player:getSkillLevel(SKILL_AXE)      == config.axe or
        player:getSkillLevel(SKILL_DISTANCE) == config.dist
    )
    and player:getSkillLevel(SKILL_SHIELD)  == config.shield
    and player:getSkillLevel(SKILL_FISHING) == config.fishing
    then
        player:setStorageValue(config.storageKey, config.storageValue)
        player:getPosition():sendMagicEffect(2)
    end

    return true
end
 
Solution
Ehm, is this maybe what u need? xD ( providing details wouldn't hurt )
Haven't tested, give it a try.

Lua:
local config = {
    mLevel  = 80,
    fist    = 50,
    club    = 60,
    sword   = 60,
    axe     = 70,
    dist    = 70,
    shield  = 121,
    fishing = 91,

    storageKey = 12345
    storageValue = 1
}

function onAdvance(player, skill, oldLevel, newLevel)

    if player:getStorageValue(config.storageKey) then
        return true
    end

    if  player:getMagicLevel() == config.mLevel
    and player:getSkillLevel(SKILL_FIST)  == config.fist
    and player:getSkillLevel(SKILL_CLUB)  == config.club
    and player:getSkillLevel(SKILL_SWORD) == config.sword
    and (
        player:getSkillLevel(SKILL_AXE)      == config.axe or
        player:getSkillLevel(SKILL_DISTANCE) == config.dist
    )
    and player:getSkillLevel(SKILL_SHIELD)  == config.shield
    and player:getSkillLevel(SKILL_FISHING) == config.fishing
    then
        player:setStorageValue(config.storageKey, config.storageValue)
        player:getPosition():sendMagicEffect(2)
    end

    return true
end
Yea but there is this part
axe = 70,
dist = 70,

so you see some of my characters cant skill distance or some characters cant skill axe so for some charcters it would be

mLevel = 80,
fist = 50,
club = 60,
sword = 60,
axe = 70,
shield = 121,
fishing = 91,

and for others

mLevel = 80,
fist = 50,
club = 60,
sword = 60,
dist = 70,
shield = 121,
fishing = 91,

so as you can see somehow need to make it so it would check axe and dist at the same time so if player have 1 dist and 80 axe he still would get the storage or if he have 1axe and 80 dist he would get the storage. Its hard to explain what im trying :D
 
Yea but there is this part
axe = 70,
dist = 70,

so you see some of my characters cant skill distance or some characters cant skill axe so for some charcters it would be

mLevel = 80,
fist = 50,
club = 60,
sword = 60,
axe = 70,
shield = 121,
fishing = 91,

and for others

mLevel = 80,
fist = 50,
club = 60,
sword = 60,
dist = 70,
shield = 121,
fishing = 91,

so as you can see somehow need to make it so it would check axe and dist at the same time so if player have 1 dist and 80 axe he still would get the storage or if he have 1axe and 80 dist he would get the storage. Its hard to explain what im trying :D

I am confused.

In your original post above you mentioned that if axe or dist is == 70 then storage should be set.
Axe Fighting - 70 or Distance Fighting - 70

and that is what I did:

Lua:
    and (
        player:getSkillLevel(SKILL_AXE)      == config.axe or
        player:getSkillLevel(SKILL_DISTANCE) == config.dist
    )
 
I am confused.

In your original post above you mentioned that if axe or dist is == 70 then storage should be set.


and that is what I did:

Lua:
    and (
        player:getSkillLevel(SKILL_AXE)      == config.axe or
        player:getSkillLevel(SKILL_DISTANCE) == config.dist
    )
Oo u already made it didnt saw this part :D
 
Back
Top