• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Script Request For TFS 1.2

gohamvsgoku

Member
Joined
Aug 21, 2017
Messages
151
Reaction score
9
I'm looking for script for premium accounts win 50 % more experience
anyone have this?

i found this script, but i got error on console

Script
LUA:
function onLogin(cid)
if getPlayerPremiumDays(cid) >= 1 then
doPlayerSetExperienceRate(cid, 1.15) -- 1.15 = +15% experience, change as you wish. Example: 2.0 = double exp
else
doPlayerSetExperienceRate(cid, 1.0) -- returns to normal rate when premium days expire
end
return true
end

Error

LUA:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/extraxp.lua:onLogin
data/creaturescripts/scripts/extraxp.lua:3: attempt to call global 'doPlayerSetExperienceRate' (a nil value)
stack traceback:
        [C]: in function 'doPlayerSetExperienceRate'
        data/creaturescripts/scripts/extraxp.lua:3: in function <data/creaturescripts/scripts/extraxp.lua:1>
Administrator has logged out.
Administrator has logged in.

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/extraxp.lua:onLogin
data/creaturescripts/scripts/extraxp.lua:3: attempt to call global 'doPlayerSetExperienceRate' (a nil value)
stack traceback:
        [C]: in function 'doPlayerSetExperienceRate'
        data/creaturescripts/scripts/extraxp.lua:3: in function <data/creaturescripts/scripts/extraxp.lua:1>
 
Last edited by a moderator:
I'm looking for script for premium accounts win 50 % more experience
anyone have this?

in data/events/scripts/player.lua update Player:onGainExperience to this:
LUA:
function Player:onGainExperience(source, exp, rawExp)
    if not source or source:isPlayer() then
        return exp
    end

    -- Soul regeneration
    local vocation = self:getVocation()
    if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
        soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
        self:addCondition(soulCondition)
    end

    -- Apply experience stage multiplier
    exp = exp * Game.getExperienceStage(self:getLevel())

    -- Stamina modifier
    if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
        useStamina(self)

        local staminaMinutes = self:getStamina()
        if staminaMinutes > 2400 and self:isPremium() then
            exp = exp * 1.5
        elseif staminaMinutes <= 840 then
            exp = exp * 0.5
        end
    end

    -- Premium modifier

    if self:isPremium() then
        exp = exp * 1.5
    end

    return exp
end
 
Back
Top