Processing the results

Get the player inside the form

Use this expression to get the player interacting with the form. For example, instead of using a variable like %player% to refer to the player, you can directly use this expression to ensure it references the player inside the form.

form(-| )player

Getting the type of the created form

form[(-| )]type of %form%
%form%'s form[(-| )]type

Available types of forms for comparison:

  • custom form
  • modal form
  • simple form

Execute the code when opening/closing the form

run (when|while) (open[ing]|clos(e|ing)) [[the] form]
run (when|while) [the] form (opens|closes)
run on form (open[ing]|clos(e|ing))
create modal form named "Modal form":
  run on form close:
    broadcast "%formplayer%" #will show the name of the player who closed the form
open last created form to player

Disable or allow closing of the form

By default, closing the form is allowed. If closing is disabled, the form will reopen after a selection is made.

cancel [the] form clos(e|ing)
uncancel [the] form clos(e|ing)

Get the reason for closing the form

This expression can only be used in the section on executing code when closing the form

[form(-| )]close reason

Available reasons for closing for comparison:

  • close
  • (submit|success)
  • invalid[ response]

Execute the code on form submit

run on form (result|submit)
create custom form named "Custom form":
  form toggle named "toggle value"
  run on form result:
    broadcast "%form toggle 1 value%"
open last created form to player

Custom form elements

This expression can only be used in the section on executing code on form submission

[form[(-| )]](drop[(-| )]down|input|slider|step[(-| )]slider|toggle) %number% [value]
value of [form[(-| )]](drop[(-| )]down|input|slider|step[(-| )]slider|toggle) %number%

For button processing Modal form and Simple form use the section on creating buttons