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

Quest giving a Key!!

Snow

New Member
Joined
Jan 16, 2008
Messages
381
Reaction score
0
I want something like the parchment room
You'll use an item and get a bag with some items and a key with x action id.

Then I also wanted to know how to make a door be openable with that key.

Thanks in Advance and ofc, rep++
 
If the item is a container, you can just assign an actionID to the key in editor. Otherwise, a custom script is required.

As for the door, you have to put same actionID on it as the key.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (getPlayerStorageValue(cid, 54321) == -1) then
        local key = doPlayerAddItem(cid, 2087)
        doSetItemActionId(key, 2087)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a wooden key.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end

try this, the chest will give you a key with actionid 2087
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (getPlayerStorageValue(cid, 54321) == -1) then
        local key = doPlayerAddItem(cid, 2087)
        doSetItemActionId(key, 2087)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a wooden key.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end

try this, the chest will give you a key with actionid 2087

I want it for multiple items...
 
Back
Top