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

[Support] addEvent

Ancores

Active Member
Joined
Jan 17, 2010
Messages
538
Reaction score
28
Why isn't this working and how can I fix it?

LUA:
function removeItem(item)
	doRemoveItem(item)
return true
end

function onSay(cid, words, param, channel)
	local item = doCreateItem(2160, 1, getCreaturePosition(cid))
	addEvent(removeItem, 5*1000, item)
return true
end

Error:
Description:
[16/02/2010 21:56:26] (luaDoRemoveItem) Item not found

Thanks.
 
UniqueID's change between script callbacks.
Code:
function removeItem(pos, itemid)
	local v = getTileItemById(pos, itemid).uid
	return v > 0 and doRemoveItem(v)
end

function onSay(cid, words, param, channel)
	local item = doCreateItem(2160, 1, getThingPos(cid))
	addEvent(removeItem, 5 * 1000, getThingPos(item), getThing(item).itemid)
	return true
end
 
Back
Top