LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local itemID = 6500
local count = getPlayerItemCount(cid, itemID)
if isPlayer(cid) and count >= 500 and getPlayerStorageValue(cid, 57388) == -1 then
doSendMagicEffect(fromPosition, 13)
setPlayerStorageValue(cid, 57388, 1)
doPlayerRemoveItem(cid, itemID, 500)
doCreatureSay(cid, "You have sacrificed 500 essences.", TALKTYPE_ORANGE_1)
else
doSendMagicEffect(fromPosition, 2)
end
return true
end
When I click something in-game, it is supposed to delete 500 demonic essences.
But, I think it's the counting that is wrong. No error in console or anything.