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

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,019
Solutions
1
Reaction score
1,029
Location
United States
Can someone give me a tutorial on how to work quest doors?
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == DOOR UID and item.itemid == ID OF THE DOOR then
    if getPlayerStorageValue(cid,XXX) == 1 then
        doTransformItem(item.uid, item.itemid + 1)
	    doTeleportThing(cid, toPosition, TRUE)
    else
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'The door seems to be sealed against unwanted intruders.')
    end
end
end

Simple. To pass it, you need a storagevalue which can be obtained from quests or NPCs.
When the door storagevalue need is equal to 1, the player can move.
Example:
I did the quest Pits of Inferno and got avenger, that, I won the storagevalue 666.
There is a door in exit of the quest, which can only pass if you have storagevalue 666 = 1. That is, you only enter if you get the avenger :p

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == DOOR UID and item.itemid == ID OF THE DOOR then
    if getPlayerStorageValue(cid,666) == 1 then
        doTransformItem(item.uid, item.itemid + 1)
	    doTeleportThing(cid, toPosition, TRUE)
    else
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'The door seems to be sealed against unwanted intruders.')
    end
end
end

That's it!
 
I thought it would be something more simpler, like level doors, you need to put a number in actionids on the mapeditor to make it work. Instead of writing 2000 different scripts for different doors, you could just simply type a number in the mapeditor.
 
Back
Top