Exports
Pause Menu Exports Documentation
The forge-pausemenu
script includes exports designed to handle cases where the Pause Menu might unintentionally appear when pressing the ESCAPE
key, especially while other user interfaces (UI) are active.
Why These Exports Are Needed
While the script uses SEND NUI
communication from other scripts to detect if a UI is open and prevent the Pause Menu from appearing, there are situations where interfaces don't utilize this mechanism. In these cases, pressing ESCAPE
can still bring up the Pause Menu unintentionally. To address this, forge-pausemenu
provides the following exports for explicit control over the menu's behavior.
Exports Overview
disableMenu
Forces the Pause Menu to be disabled, regardless of other conditions. This is useful to ensure the menu does not appear during interactions with UIs that don't triggerSEND NUI
.enableMenu
Re-enables the Pause Menu after being force-disabled, allowing it to function normally when no UI is active.setMenuState(state)
Directly sets the state of the Pause Menu (true
for enabled,false
for disabled). This is a flexible way to control the menu based on your script's logic.Parameter:
state
(boolean): The desired state of the Pause Menu.
getMenuState
Returns the current state of the Pause Menu, considering both the enabled/disabled state and any force-disable flag.Returns:
(boolean):
true
if the menu is enabled and not force-disabled,false
otherwise.
Last updated