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

Lua Adding time to this script

sick

Member
Joined
Feb 5, 2009
Messages
258
Reaction score
6
Location
Lithuania, Vilnius
So i got this script: when i use the lamp the ladder appears, when i use it again, ladder disappears, however, I need to add a line that if lamp was used 1 time and ladder appeared, ladder would disappear automatically after 1 min.

Thanks in advance :thumbup:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local gatePosition = {x=912, y=992, z=7, stackpos=1}
	local getGate = getThingFromPos(gatePosition)
	
	if(item.uid == 6658) then
		if(item.itemid == 2069 and getGate.itemid == 0) then
			doCreateItem(1386, 1, gatePosition)
			doTransformItem(item.uid, item.itemid-1)
		elseif(item.itemid == 2068 and getGate.itemid == 1386) then
			doRemoveItem(getGate.uid, 1)
			doTransformItem(item.uid, item.itemid+1)
		else
			doPlayerSendCancel(cid, "The lamp seems to be already used recently.")
		end
	end
	return TRUE
end
 

Similar threads

Back
Top