HEX
HexscriptsJobscreatorExportsClient Exports

Interaction Pages

Client exports to open and close the boss menu, kitchen, crafting menu and DJ terminal.

The four open… exports on this page all take an optional interaction id. Pass one to target a specific point, or pass nothing to use the closest one the player has access to.

exports['hex_jobscreator']:openBossMenu()        -- closest boss point
exports['hex_jobscreator']:openBossMenu(42)      -- that exact point

Prop

Type

Shared resolve reasons

Before anything opens, the point has to be resolved. All four exports can fail for these reasons:

CodeMeaning
not_loadedinteractions have not reached the client yet (player still joining)
invalid_interaction_idno interaction with that id
wrong_interaction_typethat id exists but is a different kind of point
no_permissionwrong job, or grade too low
none_configuredno point of this type that the player can use
too_farout of range of the point (the server rejects these anyway)

Each export below lists the extra reasons it can add on top.


openBossMenu

Needs a thread see Calling from a thread.

Opens the boss page.

local ok, err = exports['hex_jobscreator']:openBossMenu()

Returns

ValueMeaning
trueboss page opened
false, reasona shared resolve reason, or one below

Extra reasons

CodeMeaning
handcuffedcuffed players cannot open this
rejected_by_serverthe server refused to open it (out of range, or access changed)

Note

Calling it while the page is already open reloads it with fresh data, which is harmless.

closeBossMenu

Closes the boss page and releases NUI focus. Safe to call when it is not open, so it always returns true.

exports['hex_jobscreator']:closeBossMenu()

Returns

ValueMeaning
truealways

openKitchen

Needs a thread see Calling from a thread.

Opens the kitchen.

local ok, err = exports['hex_jobscreator']:openKitchen()

Returns

ValueMeaning
truekitchen opened
false, reasona shared resolve reason, or one below

Extra reasons

CodeMeaning
already_openthe page is already open
handcuffedcuffed players cannot open this
not_on_dutythe job has a duty point and the player is clocked out
rejected_by_serverthe server refused to open it

closeKitchen

local ok, err = exports['hex_jobscreator']:closeKitchen()

Returns

ValueMeaning
truekitchen closed
false, 'not_open'nothing was open to close

openCrafting

Opens the crafting menu.

local ok, err = exports['hex_jobscreator']:openCrafting()

Returns

ValueMeaning
truecrafting menu opened
false, reasona shared resolve reason, or one below

Extra reasons

CodeMeaning
already_craftinga craft is already running
handcuffedcuffed players cannot open this
no_recipesthe point has no recipes configured

closeCrafting

Cancels an in-progress craft if there is one, otherwise just closes the menu.

exports['hex_jobscreator']:closeCrafting()

Returns

ValueMeaning
truealways

openDJ

Needs a thread see Calling from a thread.

Opens the DJ terminal.

local ok, err = exports['hex_jobscreator']:openDJ()

Returns

ValueMeaning
trueDJ terminal opened
false, reasona shared resolve reason, or one below

Extra reasons

CodeMeaning
already_openthe page is already open
handcuffedcuffed players cannot open this
not_on_dutythe job has a duty point and the player is clocked out
rejected_by_serverthe server refused to open it

closeDJ

Closes the terminal and tells the server the player left the booth.

local ok, err = exports['hex_jobscreator']:closeDJ()

Returns

ValueMeaning
trueterminal closed
false, 'not_open'nothing was open to close