• 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 Attaching actionid to item

sowber

New Member
Joined
Sep 30, 2016
Messages
35
Reaction score
0
Hello, i'm having problems to set aid to certain item, here is my actual code (TFS 0.4 3777)

Lua:
            local key = doPlayerAddItem(cid, 2088, 1)
            if key then
            doSetItemActionId(key, 3666)
            setPlayerStorageValue(cid,53652,1)
            talkState[talkUser] = 0
            end

i'm getting the following error:

Code:
[18:14:38.037] [Error - NpcScript Interface]
[18:14:38.040] data/npc/scripts/thais/A Prisoner.lua:onCreatureSay
[18:14:38.043] Description:
[18:14:38.044] data/npc/scripts/thais/A Prisoner.lua:61: attempt to call global
'doSetItemActionId' (a nil value)
[18:14:38.049] stack traceback:
[18:14:38.051]  data/npc/scripts/thais/A Prisoner.lua:61: in function 'callback'

[18:14:38.054]  data/npc/lib/npcsystem/npchandler.lua:382: in function 'onCreatu
reSay'
[18:14:38.058]  data/npc/scripts/thais/A Prisoner.lua:8: in function <data/npc/s
cripts/thais/A Prisoner.lua:8>

Can someone solve this? I'd be really thankfull.
 
Check your /data/lib/050-function.lua, make sure you have:
Lua:
function doSetItemActionId(lols, actionid)
return doItemSetAttribute(lols, "aid", actionid)
end

If still doesn't work, try either using this function:
Lua:
doItemSetAttribute(key, "aid", 3666)
 
Back
Top