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

Lua Two GATE one lever

Zool

Banned User
Joined
Jun 9, 2009
Messages
742
Reaction score
5
Location
Poland/St Wola
Its mine
Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=1496, y=1488, z=5, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 7002 and item.itemid == 1945 and getgate.itemid == 1052 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 7002 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1052,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end

i want when click Lever make GATE ON :
{x=1496, y=1488, z=5, stackpos=1}
and [X: 1497] [Y: 1488] [Z: 5].

How add it ;p ?
 
Code:
function onUse(cid,item,fromPosition,itemEx,toPosition)
local gatepos = {[1]={x=1496, y=1488, z=5, stackpos=1},[2]={x=1497, y=1488, z=5, stackpos=1}}
	if item.uid == 7002 and item.itemid == 1945 then
		for i = 1,2 do
			if getThingFromPos(gatepos[i]).itemid == 1052 then
				for i = 1,2 do
					doRemoveItem(getThingFromPos(gatepos[i]).uid,1)
					doTransformItem(item.uid,item.itemid+1)
				end
			end
		end
	elseif item.uid == 7002 and item.itemid == 1946 then
		for i = 1,2 do
			if getThingFromPos(gatepos[i]).itemid ~= 1052 then
				for i = 1,2 do
					doCreateItem(1052,1,getThingFromPos(gatepos[i]))
					doTransformItem(item.uid,item.itemid-1)
				end
			else
				doPlayerSendCancel(cid,'Sorry, not possible.')
			end
		end
	end
	return true
end

try
 
Last edited:
Try this one, rep me if i helped ^_^




PHP:
function onUse(cid, item, frompos, item2, topos)
	wall1 = {x=1496, y=1488, z=5, stackpos=1}
	wall2 = {x=1497, y=1488, z=5, stackpos=1}
	getwall1 = getThingfromPos(wall1)
	getwall2 = getThingfromPos(wall2)

	if item.uid == 5004 and item.itemid == 1945 then
		doRemoveItem(getwall1.uid,1)
		doRemoveItem(getwall2.uid,1)
		doTransformItem(item.uid,item.itemid+1)
	elseif item.uid == 5004 and item.itemid == 1946 then
		doCreateItem(1546,1,wall1)
		doCreateItem(1546,1,wall2)
		doTransformItem(item.uid,item.itemid-1)		
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end

	return 1
end
 
Back
Top