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

Lua Exp ring or necklace TF 1.3

klarkarak

Member
Joined
Nov 19, 2011
Messages
26
Reaction score
8
Location
Mexico
Im looking an script for a ring or necklace that gives me experience when you have it equipped, plz
 
Solution
Try 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

    -- Experience Stage Multiplier
    local expStage = getRateFromTable(experienceStages, self:getLevel(), configManager.getNumber(configKeys.RATE_EXP))
    exp = exp * expStage
    baseExp = rawExp * expStage
    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then
        displayRate = expStage...
just remove that item:getAttribute thing

LUA:
function onEquip(player, item, slot)
    Game.broadcastMessage(''..player:getName()..' has equiped exp ring', MESSAGE_EVENT_ADVANCE)
    return true
end
I removed this line but still not work. Maybe add this to Creaturescript hmm. In 0.4 have transform ring aka exp ring and have it in Movements and work. something wrong. thanks for your reply
Post automatically merged:

generally whole function of necklace I put into Creaturescript/scirpt/Login.lua under onGainExperience, coz in movements doesn't work.

Maybe paste somethink in Login.lua hmmm .
This
LUA:
 Game.broadcastMessage(''..player:getName()..' has equiped exp ring', MESSAGE_EVENT_ADVANCE)
sounds good. What you otlanders Think ?
 
Last edited:
Back
Top