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

Solved Keydoor opens without key

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
heres the code

Lua:
function onUse(cid, item, frompos, itemEx, topos)
	if getPlayerItemCount(cid, 2087) >= 1 then
			doTransformItem(item.uid, item.itemid + 1)
		elseif 
			item.itemid == 5108 and getPlayerItemCount(cid, 2087) >= 1 then
			doTransformItem(item.uid, item.itemid - 1
			return true
		else
			doPlayerSendCancel(cid, "You dont have the right key!")
	end
end
 
Last edited:
Dunno, the code looks right.. Check if 5108 is in another script? Try this?
Lua:
function onUse(cid, item, frompos, itemEx, topos)
	if getPlayerItemCount(cid, 2087) >= 1 then
			doTransformItem(item.uid, item.itemid + 1)
		elseif 
			item.itemid == 5108 and getPlayerItemCount(cid, 2087) >= 1 then
			doTransformItem(item.uid, item.itemid - 1
			return true
		else
			doPlayerSendCancel(cid, "You dont have the right key!")
	end
return true
end
 
that worked, but here was what the final code ended up being that made it work:

Lua:
function onUse(cid, item, frompos, itemEx, topos)
	if getPlayerItemCount(cid, 2087) >= 1 and item.itemid == 8552 then
			doTransformItem(item.uid, item.itemid - 1)
		elseif 
			item.itemid == 8551 and getPlayerItemCount(cid, 2087) >= 1 then
			doTransformItem(item.uid, item.itemid + 1)
			return true
		else
			doPlayerSendCancel(cid, "You dont have the right key!")
	end
return true
end
 

Similar threads

Back
Top