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 pointProp
Type
Shared resolve reasons
Before anything opens, the point has to be resolved. All four exports can fail for these reasons:
| Code | Meaning |
|---|---|
not_loaded | interactions have not reached the client yet (player still joining) |
invalid_interaction_id | no interaction with that id |
wrong_interaction_type | that id exists but is a different kind of point |
no_permission | wrong job, or grade too low |
none_configured | no point of this type that the player can use |
too_far | out 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
| Value | Meaning |
|---|---|
true | boss page opened |
false, reason | a shared resolve reason, or one below |
Extra reasons
| Code | Meaning |
|---|---|
handcuffed | cuffed players cannot open this |
rejected_by_server | the 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
| Value | Meaning |
|---|---|
true | always |
openKitchen
⏳ Needs a thread see Calling from a thread.
Opens the kitchen.
local ok, err = exports['hex_jobscreator']:openKitchen()Returns
| Value | Meaning |
|---|---|
true | kitchen opened |
false, reason | a shared resolve reason, or one below |
Extra reasons
| Code | Meaning |
|---|---|
already_open | the page is already open |
handcuffed | cuffed players cannot open this |
not_on_duty | the job has a duty point and the player is clocked out |
rejected_by_server | the server refused to open it |
closeKitchen
local ok, err = exports['hex_jobscreator']:closeKitchen()Returns
| Value | Meaning |
|---|---|
true | kitchen closed |
false, 'not_open' | nothing was open to close |
openCrafting
Opens the crafting menu.
local ok, err = exports['hex_jobscreator']:openCrafting()Returns
| Value | Meaning |
|---|---|
true | crafting menu opened |
false, reason | a shared resolve reason, or one below |
Extra reasons
| Code | Meaning |
|---|---|
already_crafting | a craft is already running |
handcuffed | cuffed players cannot open this |
no_recipes | the 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
| Value | Meaning |
|---|---|
true | always |
openDJ
⏳ Needs a thread see Calling from a thread.
Opens the DJ terminal.
local ok, err = exports['hex_jobscreator']:openDJ()Returns
| Value | Meaning |
|---|---|
true | DJ terminal opened |
false, reason | a shared resolve reason, or one below |
Extra reasons
| Code | Meaning |
|---|---|
already_open | the page is already open |
handcuffed | cuffed players cannot open this |
not_on_duty | the job has a duty point and the player is clocked out |
rejected_by_server | the 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
| Value | Meaning |
|---|---|
true | terminal closed |
false, 'not_open' | nothing was open to close |