• 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 Using addEvent to doTransformItem -- "Item not found"?

Remin

New Member
Joined
Jul 6, 2008
Messages
5
Reaction score
0
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 1290 then
		doTransformItem(itemEx.uid, 391)
		addEvent(doTransformItem, 2 * 1000, itemEx.itemid, 1285)
	end
		return TRUE
end

I'm making a script where if you use an item on 1290, then it transforms into a 391, and then 2 seconds later 391 transforms into a 1285. So far the script turns 1290 into 391 with doTransformItem(itemEx.uid, 391) but I can't identify the item when i'm trying to transform it again with addEvent. Can you guys help me out? The error I get in my console is:

Code:
[18/10/2010 22:36:59] [Error - Action Interface] 
[18/10/2010 22:36:59] In a timer event called from: 
[18/10/2010 22:36:59] data/actions/scripts/saw.lua:onUse
[18/10/2010 22:36:59] Description: 
[18/10/2010 22:36:59] (luaDoTransformItem) Item not found

I am using [8.54] The Forgotten Server 0.3.6pl1 (Crying Damson)
 
Last edited:
Lua:
local changeid = 2394   -- id of the item will be transformed to
local times = 54  -- in seconds
local function t(l)
	doTransformItem(l,changeid)
	return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	addEvent(t,times*1000,itemEx.uid)
	return true
end
 
Code:
addEvent(function() doTransformItem(itemEx.uid, [COLOR="red"]XXXX[/COLOR]) end, 5 * 1000)
 
Back
Top