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

TFS 1.X+ Experience Boost Issue

froy

Active Member
Joined
Sep 30, 2009
Messages
151
Solutions
3
Reaction score
36
Hey! I'm having some problems with adding a scroll for adding extra gained experience for x amount of time.

For every search on OTLand I've been finding servers using event/player.lua file.
Im using the nostalrius distro 7.72 tfs 1.2 and it's not using an event folder.
Endless hours of trying and no succes.

Im using code from this:


Any help is much appreciated!
 
creaturescript onKill

Code:
local multiplier = 0.5 -- +50% bonus experience, this goes before function onKill

if target:isMonster() then
    local mtype = MonsterType(target:getName())
    if mtype then
        local xp = mtype:getExperience()
        player:addExperience(xp * multiplier)
    end
end

obviously has to be registered and has to be gated by some storage
 
mensagem ERROR
Post automatically merged:

creaturescript onKill

Code:
local multiplier = 0.5 -- +50% bonus experience, this goes before function onKill

if target:isMonster() then
    local mtype = MonsterType(target:getName())
    if mtype then
        local xp = mtype:getExperience()
        player:addExperience(xp * multiplier)
    end
end

obviously has to be registered and has to be gated by some storage

Thank you very much. Would you know how to instruct me to carry out your last instruction/observation? I'm a student in the area, and I didn't find the right way to do it.
 
Last edited:
storage check (if you're using a different script, you'll have to copy the script config or replace it with number manually)
Code:
if player:getStorageValue(config.storage) >= os.time() then
-- code goes here
end

registering in creaturescripts: you have to add kill event in creaturescripts.xml file and register that event in login.lua
function onKill examples can be found in any task system
 
Back
Top