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

Simple lever

GuHB

Member
Joined
Dec 14, 2009
Messages
630
Reaction score
9
Location
Brazil
Why this simple lever doesn't always work?

Lua:
local gatepos = {x=4816, y=5058, z=10, stackpos=1}

function onUse(cid, item, frompos, item2, topos)
local getgate = getThingfromPos(gatepos)

	if item.itemid == 1945 and getgate.itemid == 1355 then
		doRemoveItem(getgate.uid, 1)
		doTransformItem(item.uid, item.itemid+1)
	elseif item.itemid == 1946 and getgate.itemid == 0 then
		doCreateItem(1355, 1, gatepos)
		doTransformItem(item.uid, item.itemid-1)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end
return 1
end

Thanks for the attention.
 
Why this simple lever doesn't always work?

Lua:
local gatepos = {x=4816, y=5058, z=10, stackpos=1}

function onUse(cid, item, frompos, item2, topos)
local getgate = getThingfromPos(gatepos)

	if item.itemid == 1945 and getgate.itemid == 1355 then
		doRemoveItem(getgate.uid, 1)
		doTransformItem(item.uid, item.itemid+1)
	elseif item.itemid == 1946 and getgate.itemid == 0 then
		doCreateItem(1355, 1, gatepos)
		doTransformItem(item.uid, item.itemid-1)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end
return 1
end

Thanks for the attention.

Hmm this lever should work, make sure you use the right uniqueID in your mapeditor and your actions.xml...
 
Back
Top Bottom