<action actionid="5000" script="yourscript.lua"/>
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1740 then
queststatus = getPlayerStorageValue(cid, 5000)
if queststatus == -1 then
setPlayerStorageValue(cid, 5000, 1)
doPlayerAddItem(cid, 2493, 1)
else
doPlayerSendTextMessage(cid, 22, "it is empty.")
end
end
return 1
end
example
put the action id = 5000 of the quest chest from map editor
then action.xml
and create new file.luaCode:<action actionid="5000" script="yourscript.lua"/>
LUA:function onUse(cid, item, frompos, item2, topos) if item.itemid == 1740 then queststatus = getPlayerStorageValue(cid, 5000) if queststatus == -1 then setPlayerStorageValue(cid, 5000, 1) doPlayerAddItem(cid, 2493, 1) else doPlayerSendTextMessage(cid, 22, "it is empty.") end end return 1 end
![]()
if you get any problem post hereeace: