• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help regarding quest door

Michael Orsino

Premium User
Premium User
Support Team
Joined
Nov 15, 2007
Messages
864
Solutions
10
Reaction score
451
Location
Western Australia
Hey there, can't work out how to make a quest door work. Deleted my script in anger, maybe you can help? I'll outline it below.

item id 1255
uid 9876
if storage 9876 = 1
then let the player pass
else cancel

Thanks a lot
 
PHP:
function onUse(cid, item, frompos, item2, topos)
   	if item.uid == 9876 then
   		queststatus = getPlayerStorageValue(cid, 9876)
   		if queststatus == 1 then

			pos = getPlayerPosition(cid)

			if pos.x == topos.x then
				if pos.y < topos.y then
					pos.y = topos.y + 1
				else
					pos.y = topos.y - 1
				end
			elseif pos.y == topos.y then
				if pos.x < topos.x then
					pos.x = topos.x + 1
				else
					pos.x = topos.x - 1
				end
			else
				doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
				return TRUE
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
		else
			doPlayerSendTextMessage(cid,22,'You need to complete a quest, then you can pass.')
		end
		return TRUE
	else
		return FALSE
	end
end
 
Back
Top