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

Error In Machete code

Captain Orhotek

New Member
Joined
May 20, 2009
Messages
118
Reaction score
1
Maybe its something simple but I do not see the error that would make both of those not work. For a while the bamboo (second part of code) was working but it made the top part not work. I tried a lot of different things but I am just not getting it right..can anyone help?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 2782 then
		doTransformItem(itemEx.uid, 2781)
		doDecayItem(itemEx.uid)
		return TRUE
	end
	return destroyItem(cid, itemEx, toPosition)
  end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 3799 then
		doRemoveItem(itemEx.uid)
		doDecayItem(itemEx.uid)
		return TRUE
	end
	return destroyItem(cid, itemEx, toPosition)
  end
end
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 2782 then
		doTransformItem(itemEx.uid, 2781)
		doDecayItem(itemEx.uid)
	elseif itemEx.itemid == 3799 then
		doRemoveItem(itemEx.uid)
		doDecayItem(itemEx.uid)
	end
	return TRUE
end
Try this..
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 2782 then
		doTransformItem(itemEx.uid, 2781)
		doDecayItem(itemEx.uid)
		return TRUE
	end
	return destroyItem(cid, itemEx, toPosition)
  end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 3799 then
		doRemoveItem(itemEx.uid)
		doDecayItem(itemEx.uid)
		return TRUE
	end
	return destroyItem(cid, itemEx, toPosition)
  end
You had 1 extra end.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		if itemEx.itemid == 2782 then
			doTransformItem(itemEx.uid, 2781)
			doDecayItem(itemEx.uid)
			return TRUE
		end
		if itemEx.itemid == 3799 then
			doRemoveItem(itemEx.uid)
			doDecayItem(itemEx.uid)
			return TRUE
		end
		return destroyItem(cid, itemEx, toPosition)
	end
My script.
 
Back
Top