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

Lua Skill up/ no Max

Gaber Zen

Well-Known Member
Joined
Apr 22, 2023
Messages
224
Reaction score
51
Location
Egypt
Hi, guys
im have Script For Get skills Distance, but how i add Max 130
Lua:
function onUse(cid, item, frompos, item2, topos)

if item.itemid == 6541 then

rand = math.random(1,1)

if rand == 1 then
doPlayerAddSkillTry(cid,4,2 * 35000)
doRemoveItem(item.uid,1)
doSendMagicEffect(frompos, 28)
doSendAnimatedText(getPlayerPosition(cid), "Skill Up", TEXTCOLOR_BLUE)

end
end
return 1
end
 
i add the code but erro
function onUse(cid, item, frompos, item2, topos)

if item.itemid == 6541 then

rand = math.random(1,1)

if rand == 1 then
doPlayerAddSkillTry(cid,4,2 * 35000)
doRemoveItem(item.uid,1)
if getPlayerSkillLevel(cid, 4) <= 130 then
doSendMagicEffect(frompos, 28)
doSendAnimatedText(getPlayerPosition(cid), "Skill Up", TEXTCOLOR_BLUE)

end
end
return 1
end
 
i add the code but erro
you missed an end
try
Lua:
function onUse(cid, item, frompos, item2, topos)

    if item.itemid == 6541 and getPlayerSkillLevel(cid, 4) <= 130 then
       
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "you get lvl 130 distance")
        local rand = math.random(1, 1) --wtf?
        if rand == 1 then --always is true
            doPlayerAddSkillTry(cid, 4, 2 * 35000)
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(frompos, 28)
            doSendAnimatedText(getPlayerPosition(cid), "Skill Up", TEXTCOLOR_BLUE)

        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "you dont use this")
    end
    return 1
end

Just out of curiosity, what happens if you normally go up distance?
If you are 130 and I go up, would you normally go up to 131?
Do you allow that or do you forbid it?

if forbid
add that too
creaturescripts
and register in login
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)

    if getPlayerSkillLevel(cid, 4) >= 130 then

        doPlayerSetRate(cid, 0, 0)

    end

    return true
end
 
Last edited:
you missed an end
try
Lua:
function onUse(cid, item, frompos, item2, topos)

    if item.itemid == 6541 and getPlayerSkillLevel(cid, 4) <= 130 then
        print("i can use , because distance < 130")
        local rand = math.random(1, 1) --wtf?
        if rand == 1 then
            doPlayerAddSkillTry(cid, 4, 2 * 35000)
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(frompos, 28)
            doSendAnimatedText(getPlayerPosition(cid), "Skill Up", TEXTCOLOR_BLUE)

        end
    else
        print("i not cant use because distance > 130")
    end
    return 1
end

Just out of curiosity, what happens if you normally go up distance?
If you are 130 and I go up, would you normally go up to 131?
Do you allow that or do you forbid it?

if forbid
add that too
creaturescripts
and register in login
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)

    if getPlayerSkillLevel(cid, 4) >= 130 then

        doPlayerSetRate(cid, 0, 0)

    end

    return true
end
Yes is working good, but player dont see max
I use the script magic level but cant add max
Lua:
function onUse(cid, item, frompos, item2, topos)

if item.itemid == 6543 then

rand = math.random(1,1)

if rand == 1 then
doPlayerAddSpentMana(cid, 4100000)
doRemoveItem(item.uid,1)
doSendMagicEffect(frompos, 28)
doSendAnimatedText(getPlayerPosition(cid), "Magic Up!", TEXTCOLOR_BLUE)

end
end
return 1
end
 
Last edited:
all code is working good and eggs stop working after 131, but player dont know
how fix for magic level Script <the code is working for magic but can get 200 or 300 > i need to top 130 too how fix
i dot it > Thanks my brother
Lua:
function onUse(cid, item, frompos, item2, topos)

    if item.itemid == 6543 and getPlayerMagLevel(cid) <= 120 then
        print("i can use , because Magic < 120")
        local rand = math.random(1, 1) --wtf?
        if rand == 1 then
            doPlayerAddSpentMana(cid, 4100000)
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(frompos, 28)
            doSendAnimatedText(getPlayerPosition(cid), "Magic Up", TEXTCOLOR_RED)

        end
    else
        print("i not cant use because Magic > 120")
    end
    return 1
end
 
Last edited:
Back
Top