I am using this script to make an on use item spawn a creature, the help i need is how to make the item delete its self after use. thank for the help.
Code:
function onUse(cid, item, frompos, item2, topos)
local config = {monster = "demon"}
local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)
if(dir==1)then
pos.x = pos.x + 1
elseif(dir==2)then
pos.y = pos.y + 1
elseif(dir==3)then
pos.x = pos.x - 1
elseif(dir==0)then
pos.y = pos.y - 1
end
if item.itemid == 2348 then
doCreateMonster(config.monster, pos)
end
return LUA_NO_ERROR
end