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

Use lever to enter door

Goten

...
Joined
Oct 23, 2008
Messages
216
Reaction score
0
Hello I need help,
I want that if you use a lever with the uid 1337, it gives the player a storagvalue..
like storagevalue "1234", if the player use the door before he used the lever then he get a message that says You can pass, first you need to find the lever for this door..
And if you used the lever, then you can enter the door, and it gives a message like You may pass, but be carefull..

I hope someone can help me ;)
 
in actions/script make

questdoor.lua

Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.uniqueid == 1338 and getPlayerStorageValue(cid,14000) >= 1) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "go get youre items!", TALKTYPE_ORANGE_1)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "go get youre items!", TALKTYPE_ORANGE_1)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "you need to do the quest to enter this door.")
			return TRUE
	end
	return FALSE
end


and in actions/script make

leverquest.lua

Code:
		function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (item.uniqueid (cid,1337).itemid == 1945) and (getPlayerStorage(cid,14000) == -1) then
		setPlayerStorageValue(cid,14000,1)
		doTransformItem(item.uid,1946)
	elseif
	(getPlayerStorage(cid,14000) == 1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already pulled the lever.")
     elseif item.itemid == 1946 then
		doTransformItem(item.uid,1945)
		return true
			end
		end
	end	
end

and in actions.xml
Code:
    <action uniqueidid="1338" script="quests/questdoor.lua" />
	<action uniqueid="1337" script="quests/questlever.lua" />

the lever uniqueid = 1337 and the door uniqueid = 1338
this should work the x.y.z of the door are to the left so its for a horizontal door
the player enters the door from right side to left side.

the door script------Credits StreamSide and Empty
and the lever script is from willy wonka so be nice and buy his chocolat ^^
i hope this helped you
 
Last edited:
Back
Top