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

Problem adding actionid on key in quest chest

jodeb

New Member
Joined
Mar 10, 2017
Messages
4
Solutions
1
Reaction score
0
So I have spent hours surfing the forums and have tried many different ideas. I'm running forgotten 1.2 i think it is -.- what I need to do is add the actionid to the key that is looted from the chest box. I know the text should go after doplayeradditem but I can't figure out what it is. Any help would be greatful and sorry in advance i'm noob at this
Lua:
function onUse(cid, item, frompos, item2, topos)
    elseif item.uid == 62356 then
        if getPlayerStorageValue(cid,62356) == -1 then
            doPlayerAddItem(cid, 2089, 1)
        end
            doPlayerSendTextMessage(cid,22,"You have found a copper key.")
            setPlayerStorageValue(cid,62356,1)
        else
            doPlayerSendTextMessage(cid,22,"This chest is empty.")
        end 
    return TRUE
end
 
Last edited:
Solution
Did you try? Did you set it up correctly?
Made a chest, put a key in it and assigned actionId?
FFS i guess i didnt try the main post there just the other one listed there. meanless to say the main post worked Thank You for your help. i got sloppy spent to long looking at it.
Lua:
doSetItemActionId(uid, actionId)
is this what you need?
post more of the script and ill tell you where to put it, it doesn't look quite right
 
Check your server version again, because you wrote you're using TFS 1.2, but your code is old.
There are many of cool chest systems on the forum you can use. Easy and convenient.
Action - [TFS 1.X] Reward Chest
from what i have seen that wont help me with the key action id. im noob at this tring to learn it. and i checked its theforgottenserver-v1.2-win64
 
from what i have seen that wont help me with the key action id. im noob at this tring to learn it. and i checked its theforgottenserver-v1.2-win64
Did you try? Did you set it up correctly?
Made a chest, put a key in it and assigned actionId?
 
Did you try? Did you set it up correctly?
Made a chest, put a key in it and assigned actionId?
FFS i guess i didnt try the main post there just the other one listed there. meanless to say the main post worked Thank You for your help. i got sloppy spent to long looking at it.
 
Solution
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local key = item:setActionId(62356)
    if not key then
        return true
    end

    if player:getStorageValue(62356) == 1  then
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It is empty.')
    else
    player:setStorageValue(62356, 1)
    player:addItem(2089)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a copper key.')
        return true
    end

   
    return true
end
 
Back
Top