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
disableMenuForces 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.exports['forge-pausemenu']:disableMenu()enableMenuRe-enables the Pause Menu after being force-disabled, allowing it to function normally when no UI is active.exports['forge-pausemenu']:enableMenu()setMenuState(state)Directly sets the state of the Pause Menu (truefor enabled,falsefor 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.
exports['forge-pausemenu']:setMenuState(false)getMenuStateReturns the current state of the Pause Menu, considering both the enabled/disabled state and any force-disable flag.Returns:
(boolean):
trueif the menu is enabled and not force-disabled,falseotherwise.
local isMenuActive = exports['forge-pausemenu']:getMenuState()
Last updated