• 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 Quest Lever Script!

korff

New Member
Joined
Sep 11, 2009
Messages
78
Reaction score
3
Not working, Why?

erro2b.png


HTML:
function onUse(cid, item, frompos, item2, topos)
endgatepos = {x=234, y=377, z=8, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 1016 and item.itemid == 1945 and getgate.itemid == 1355 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 1016 and 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
 
try this
Lua:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=234, y=377, z=8, stackpos=1}
getgate = getThingFromPos(gatepos)

if item.uid == 1016 and item.itemid == 1945 and getgate.itemid == 1355 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 1016 and 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
 
Code:
local t = {
	pos = {x=234, y=377, z=8},
	itemid = 1355
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doRemoveItem(getTileItemById(t.pos, t.itemid).uid)
	else
		doCreateItem(t.itemid, 1, t.pos)
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top