function onUse(cid, item, fromPosition, itemEx, toPosition)
local num = 30153 -- Enter some number here that is not used anywhere else as a storage value key
local cooldown = 60*30 -- Enter the cooldown for the box in seconds
local reward = 2160 -- Enter the reward ID here
if not(exhaustion.check(cid,num)) then -- If it's not on cooldown
exhaustion.set(cid, num, cooldown) -- Sets the cooldown to desired time
doPlayerAddItem(cid, reward, 1) -- Adds 1x of the reward
doCreatureSay(cid, "Found a reward!", TALKTYPE_MONSTER) -- Some text to display when box is used
else -- If the box is on cooldown
doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, num).." seconds before you can use the box again.") -- Send an error message to the player
doSendMagicEffect(getThingPos(cid), 2) -- Send the poff effect
end
return true
end