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

Key+locked door=Unlocked door!!!

Xzrnoth

New Member
Joined
Dec 8, 2008
Messages
16
Reaction score
1
Using O.3 b1, How do I make it so locked door's are unlocked with certain keys? What Unique id's action id's etc? Sorry still learning, thank you
 
Code:
function onUse(cid, item, fromPosition, toPosition)

    if getPlayerStorageValue(cid,1337) < 1 then
        local key = doPlayerAddItem(cid,KEYID,1)
        setItemActionId(key,1337)
        setPlayerStorageValue(cid,1337,1)
        doPlayerSendTextMessage(cid,24,"You have found a key.")
    else
        doPlayerSendTextMessage(cid,24,"It is empty.")
    end
end
 
Empty is this right ?
function onUse(cid, item, fromPosition, toPosition)

if getPlayerStorageValue(cid,1337) < 1 then
local key = doPlayerAddItem(cid,KEY ID,1)
setItemActionId(key,ACTIONID)
setPlayerStorageValue(cid,ACTIONID,1)
doPlayerSendTextMessage(cid,24,"THE TEXT WHEN YOU LOOT THE QUEST BOX")
else
doPlayerSendTextMessage(cid,24,"THE TEXT IF YOU ALREDY LOOTED THIS BOX")
end
end
 
Yes, that is right. Just replace KEY ID with the itemID of the key. And ACTIONID with the actionid you've used on the door.
 
Back
Top