is_item_on_cooldown
The is_item_on_cooldown function checks if a specified item is currently on cooldown. This function is useful for determining whether an item can be used or if it is still on cooldown.
Parameters
item_name(string): The name or ID of the item to check.
Returns
is_on_cooldown(boolean): Returnstrueif the item is on cooldown, otherwise returnsfalse.
Example Usage in Lua
Here is an example of how to use the is_item_on_cooldown function in Lua:
local api = ...
-- Function to check if an item is on cooldown and print the result
function CheckItemCooldown(item_name)
local is_on_cooldown = api.is_item_on_cooldown(item_name)
if is_on_cooldown then
print("The item '" .. item_name .. "' is currently on cooldown.")
else
print("The item '" .. item_name .. "' is not on cooldown.")
end
end
-- Example usage: Check if the item "Health Potion" is on cooldown
CheckItemCooldown("Health Potion")