CheckIfInventoryBlocked
The CheckIfInventoryBlocked
export allows you to check if the player's inventory is currently blocked (for example, when they are in a menu or in a restricted situation where they can't interact with their inventory).
This is useful for ensuring certain actions only happen when the inventory is accessible.
How to Use
To check if the inventory is blocked, use the following code:
Here’s an example of a command that checks if the player's inventory is blocked:
This example checks if the inventory is blocked when using the /checkinventory
command.
If the inventory is blocked, it will print a corresponding message; otherwise, it will confirm that the inventory is usable.
Last updated