Lua Code:
local function TryUseCollectible(id, actorCategory)
if not IsCollectibleUsable(id, actorCategory) then
return
end
local cooldownRemaining, cooldownDuration = GetCollectibleCooldownAndDuration(id)
if cooldownRemaining > 0 then
CHAT_ROUTER:AddSystemMessage(string.format("Try to use after %0.1fs cooldown", cooldownRemaining / 1000))
zo_callLater(function()
UseCollectible(id, actorCategory)
end, cooldownRemaining + 100)
return
end
UseCollectible(id, actorCategory)
end