• 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 door/chest openable after part 1 of a quest is complete?

kessykins

Intermediate OT User
Joined
Mar 15, 2010
Messages
297
Reaction score
105
Ok so I'm trying to make it so when a player has completed part 1 of a quest they can open a quest door<which will change their storage to ###, 3..> and give them access to the chest. Once they open the chest and return to the npc they'll be able to get the next part of the quest

What do I need to change on the door? any char above a certain lvl can open it x.x
I think I mixed up the actionid and uniqueids.. I'm not sure


The door is set to actionid 30000. This is the lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 30000 and item.itemid == 1225 then
    if getPlayerStorageValue(cid,30000) == 2 then
        doTransformItem(item.uid, item.itemid + 1)
        doTeleportThing(cid, toPosition, TRUE)
		setPlayerStorageValue(cid,30000,3)	
    else
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'The door seems to be sealed against unwanted intruders.')
    end
end
end

The chest is set to uniqueid 29000. This is the chest lua

Code:
function onUse(cid, item, frompos, item2, topos)
			 if item.uid == 29000 then
queststatus = getPlayerStorageValue(cid,29000)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a special item.") 
doPlayerAddItem(cid,10515,1)
setPlayerStorageValue(cid,29000,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
return 1
end


++REP for help
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1225 then
		if getPlayerStorageValue(cid, 30000) >= 2 then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, true)
			if getPlayerStorageValue(cid, 30000) < 3 then
				setPlayerStorageValue(cid, 30000, 3)
			end
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'The door seems to be sealed against unwanted intruders.')
		end
	end
	return true
end
Code:
if item.uid == 30000
Code:
if item.uid == 29000
Unless you are sharing the same script for multiple objects, you don't need to make such checks.
 
Back
Top