• 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 Error with offline training

ItsMeMagic

Old Tibia Player.
Joined
Sep 11, 2008
Messages
318
Reaction score
25
Location
exiva "Magic~
an error appears in console and obviously i cant use the statues...

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/offlinetraining.lua:onUse
data/actions/scripts/other/offlinetraining.lua:25: attempt to call global 'doPlayerSetOfflineTrainingSkill' (a nil value)
stack traceback:
[C]: in function 'doPlayerSetOfflineTrainingSkill'
data/actions/scripts/other/offlinetraining.lua:25: in function

this is my offlinetraining.lua

Code:
local statue = {
    [18488] = SKILL_SWORD,
    [18489] = SKILL_AXE,
    [18490] = SKILL_CLUB,
    [18491] = SKILL_DISTANCE,
    [18492] = SKILL_MAGLEVEL
    }
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local premiumDays = getPlayerPremiumDays(cid)

    if (isPlayerPzLocked(cid)) then
        return false
    end
    if (isPremium(cid)) then
        doPlayerSetOfflineTrainingSkill(cid, statue[item.itemid])
        doRemoveCreature(cid)
    else
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
    end
    return true
end

Thanks, sorry for so many requests..
 
Thanks Limos !
Solid answers as usuall

Limos i replace the offinetrainning.lua but it use the statue but doesnt train offline..
should i execute a command in sql?
cause is not working..
 
Last edited by a moderator:
7428c25509eb95e996961dd6c0ae2c3f.png

what with this error?
 
Back
Top