Code:
local config = {
-- snake position 1
snake = {x=32858, y=32526, z=11, stackpos=1},
-- Time to remove snake in Seconds
timeToRemove = 5,
timeToRemove2 = 6,
}
function onUse(cid, item, fromPos, item2, toPos)
if item.itemid == 4861 then
local getsnake = getThingfromPos(config.snake)
doRemoveItem(getsnake.uid)
doCreatureSay(cid, "The cobra has been destroyed.", TALKTYPE_ORANGE_1)
addEvent(doCreateItem, config.timeToRemove * 1000, 4861, 1, config.snake)
--->>> NOT WORKING addEvent(doItemSetAttribute,config.timeToRemove2 * 1000, config.snake, "actionid", 44406)
else
doCreatureSay(cid, "?.", TALKTYPE_ORANGE_1)
doTransformItem(item.uid,item.itemid-1)
end
return TRUE
end
That's my script, the only thing is not working is changing newly made item's action id
I'm getting error in my console that item is not found.
Temp solved by making itemid instead of actionid ;]
Last edited: