Cooldowns

The utility library comes equipped with a full cooldown system to allow for setting cooldowns locally or globally across the server.

Cooldown functions are both client and server side.

Client Functions

Below is a list of all the available functions related to cooldowns which can be accessed through the utils object client side.

utils.cooldowns.check = check_cooldown

check_cooldown

Can be used to check a cooldown on the client side.

utils.cooldowns.check(cooldown_type, is_global, cb)

Server Functions

Below is a list of all the available functions related to cooldowns which can be accessed through the utils object server side.

utils.cooldowns.add = add_cooldown
utils.cooldowns.check = check_cooldown
utils.cooldowns.clear = clear_cooldown
utils.cooldowns.clear_for_resource = clear_resource_cooldowns

add_cooldown

Can be used to add a cooldown for a specific action, optionally for a global scope or for a specific player, and tracks the invoking resource.

utils.cooldowns.add(source, cooldown_type, duration, is_global)

check_cooldown

Can be used to check the status of a specific cooldown.

utils.cooldowns.check(source, cooldown_type, is_global)

clear_cooldown

Can be used to clear a specific cooldown.

utils.cooldowns.clear(source, cooldown_type, is_global)

clear_resource_cooldowns

Can be triggered to clear all cooldowns for a specific resource.

utils.cooldowns.clear_for_resource(resource_name)

Last updated