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

Solved TFS 1.0 oldlevel ~= newlevel

Shadow Dan

Sh4dowDan
Joined
Jun 5, 2010
Messages
344
Reaction score
88
Location
Poland
Code:
function onAdvance(cid, type, oldlevel, newlevel)

if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
this line:
Code:
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
not working, no error in console, it just dont pass it when i lvl up.
Its from old script and i can't find how to make it working.

Code:
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
    if (newlevel >= 20 and getPlayerStorageValue(cid, 70580) == -1) then
        if isPlayer(cid) == TRUE then
            doPlayerAddItem(cid,2152,20)
            doPlayerSendTextMessage(cid, 19, 'You gain 20 platinum coins, reward for the level of experience gained.')
            setPlayerStorageValue(cid, 70580, 1)
        end
    end
end

#edit
i found this:
Code:
if skill ~= 8 or newLevel <= oldLevel then
        return true
    end
 
Last edited:
I haven't had the reason to use this function, but what you could do is use a storage value to store the player highest level. And then use the storage value to compare it with new level.

just use some prints like
print(newLevel..oldLevel)
print("oldLevel = "..oldLevel.." newLevel = "..newLevel)
 
I solved this thanks for reply tho.
used this:
Code:
if skill ~= 8 or newLevel <= oldLevel then
return true
end
I found this on advance_save.lua
so 8 == skill level, only that i wanted to know.
 
Back
Top