• 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 help (keys)

zitubia

New Member
Joined
Sep 30, 2007
Messages
45
Reaction score
0
Hello i bet this one is very easy for you guys but im wondering.
I want to make a simple quest with a chest.

That chest would hold a key with a Unique number. Example "Silver key: 5681"

Is it possible to make this in map editor or must i make it a lua script for that chest/UID?

If not i need to make it a daily spawn.

BTW
If i make a key. How do i do so it works only for one door?
Should the door have same AID as the key's AID?

Thanks in Advance
 
Try:
data/actions/scripts/chest.lua
Lua:
local storage = 35000
local aid = xxxx ---- AID you will set for the key, that matches door
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,storage) == -1 then
   setPlayerStorageValue(cid,storage,1)
      doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a silver key")
      doItemSetAttribute(doPlayerAddItem(cid,5681,1), 'aid', aid)
   else
       doPlayerSendTextMessage(cid,MESSAGE_INFO_dESCR,"It is empty")
       end
   return true
end

data/actions/actions.xml
XML:
<action uniqueid="48690" event="script" value="chest.lua"/>
Thats the uniqueID you will put at map for chest.
Try it :)
 
Last edited:
the 5681 was the number of the key (not the sprite) xD i ment like this Example You see a Silver key (5681). or what it say in game. Is that possible too?
Or is it automated from the AID itself?

btw why do the other code say azerus.lua?

Thanks for the quick answer, i will use this for sure.

/ zitubia
 
Uhm, okay.
Just put the itemID of your key here:
Lua:
(doPlayerAddItem(cid,5681,1)
Instead of 5681 and test ;)
Fixed the azerus thingy
Btw, the key doesn't have an automated AID, I set the key an AID with doItemSetAttribute, and I put the key an spcified AID, (you put it in local aid = xxxx) then just it has to match door :D
 
Back
Top