local storage, duration = 1.4, 1.4
-- Handles onBuy events. If you wish to handle this yourself, use the CALLBACK_ONBUY callback.
function NpcHandler:onBuy(creature, itemid, subType, amount, ignoreCap, inBackpacks)
local cid = creature.uid
if (os.time() - getPlayerStorageValue(cid, storage)) >= duration then
setPlayerStorageValue(cid, storage, os.time())
local callback = self:getCallback(CALLBACK_ONBUY)
if callback == nil or callback(cid, itemid, subType, amount, ignoreCap, inBackpacks) then
if self:processModuleCallback(CALLBACK_ONBUY, cid, itemid, subType, amount, ignoreCap, inBackpacks) then
--
end
end
else
return false
end
end