• 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 Player event script assistance.

Caduceus

Unknown Member
Joined
May 10, 2010
Messages
321
Solutions
2
Reaction score
24
if self:getStorageValue(1234) >= os.time() then
exp = exp * 4.0 * Game.getExperienceStage(self:getLevel())
end
Having an issue that I can't seem to figure out. The section quoted above is not registering. I am getting no errors in console. I have tried using else if as well, but no luck.

Code:
function Player:onGainExperience(source, exp, rawExp)
    if self:isVip() then
        return exp * 2.0 * Game.getExperienceStage(self:getLevel())
    else
    exp = exp * Game.getExperienceStage(self:getLevel())
    end
    if self:getStorageValue(1234) >= os.time() then
    exp = exp * 4.0 * Game.getExperienceStage(self:getLevel())
end
     return exp
end
 
Is the character you try it with a vip character, if so then this part has to be re worked:
Code:
if self:isVip() then
return exp * 2.0 * Game.getExperienceStage(self:getLevel())
 
I dont like that you return the exp, just let it add up and then return it:

Code:
function Player:onGainExperience(source, experience, rawExperience)
    if self:isVip() then
        experience = experience * 2
    end

    if self:getStorageValue(1234) >= os.time() then
        experience = experience * 4
    end

    return experience * Game.getExperienceStage(self:getLevel())
end
 
Back
Top