FLOODGATE

This module allows you to interact with the plugin Floodgate , and also create interactive forms

A plugin is required for the module to work Floodgate

Check that the player has logged in with Bedrock Edition

%player% [(is|does)](n't| not) from floodgate

Get the localization of the player

[the] be[[drock] [edition]] (locale|language) of [the] [floodgate] %player%           
%player%'s be[[drock] [edition]] (locale|language) [of [the] floodgate]

Get the name of the player’s device

[the] [be[[drock] [edition]]] (platform|device) of [the] [floodgate] %player%
%player%'s [be[[drock] [edition]]] (platform|device) [of [the] floodgate]

Get the Bedrock version of the client

[the] be[[drock] [edition]] version of [the] [floodgate] %player%
%player%'s be[[drock] [edition]] version [of [the] floodgate]

Subsections of Floodgate

FORM TYPES

Creating a new form

It is the simplest form, which has only two buttons and a description block. The buttons are a conditional choice of ‘yes’ or ’no’.
The created form will be placed in the expression last created form

create [a] [new] modal form (with (name|title)|named) %string%
create modal form named "Modal form":
  set form content to "Please select one option"
  run on form close:
    broadcast "closed"
  run on form open:
    broadcast "opened"
  form button named "I like skript!":
    broadcast "Thank you!!!"
  form button named "I didnt like skript!":
    broadcast "USE DENIZEN INSTEAD!!!"
open last created form to player

modal form
modal form

Simple form

It is a form with buttons. There can be an unlimited number of buttons, in addition, the buttons can have images from the Internet.
The created form will be placed in the expression last created form

create [a] [new] simple form (with (name|title)|named) %string%
create simple form named "Simple form":
  form button named "button 1" with image "https://pics.clipartpng.com/Carrots_PNG_Clipart-465.png":
    broadcast "button 1 pressed"
  form button named "button 2":
    broadcast "button 2 pressed"
  form button named "button 3":
    broadcast "button 3 pressed"
open last created form to player

simple form
simple form

Custom form

It is a form with any elements except buttons. This type of forms allows you to use sliders, switches, input fields, selection fields, etc.
The processing of the form elements is carried out in the section on form result
The created form will be placed in the expression last created form

create [a] [new] custom form (with (name|title)|named) %string%
create custom form named "Custom form":
  form dropdown named "Select one value from list" with elements "one", "two", "three"
  form input named "Your password?" with placeholder "write your password"
  form label named "sample text"
  form slider named "music volume????" with minimum value 0 and maximum value 10
  form textslider named "select shit" with elements "value 1","value 2","value 3"
  form toggle named "yes or no?"
  run on form result:
    broadcast "%form toggle 1 value%"
open last created form to player

custom form
custom form

Last created form

[the] (last[ly] [(created|edited)]|(created|edited)) form

Open the form to the player

open %form% (for|to) %players%

FORM ELEMENTS

Buttons

The button is a section, the code inside of which will be executed when you click on it. After clicking on the button, the form will be automatically closed (a feature of Bedrock forms).

Can only be used in Modal form and Simple form .
The button with the image can only be used in Simple form

form(-| )button ((with (name|title))|named) %string% [with image %string%]
create modal form named "Modal form":
  form button named "My button":
    broadcast "Pressed button"
open last created form to player

Description of Modal form.

Allows you to specify or get a text description in Modal form. Allows you to specify both in an already created form and in the creation section Modal form

form['s] content
content of form 
%form%['s] content
content of %form%
create modal form named "Modal form":
  set content of form to "Sample text"
open last created form to player

Custom form Elements

Get the value of the Custom form Elements after closing, it is possible only in the section run on form result.

User Input element

Creates an element in which the user can enter any text. Allows you to specify the initial text inside the field, and the placeholder text

form(-| )input (with name|named) [%string% (with|and) [placeholder] %string%[(, | (with|and) ) [def[ault] [value]] %string%]]
Choosing from the list

Creates an element in which the user can select one of the suggested values. Allows you to specify the initial value by index.

form(-| )drop[(-| )]down (with name|named) %string% (with|and) [elements] %strings%[(, | (with|and) ) [def[ault] [(element [index]|index)]] %number%]
Label, note, text

Creates an element with text.

form(-| )label [(with (name|title)|named)] %string%
A slider with a numeric value selection

Creates an element in the form of a strip with a control in which the user can specify a value. Allows you to specify the minimum and maximum threshold of numbers, the initial value and the slider step.

form(-| )slider (with name|named) %string% [[(with|and) [min[imum] [value]] %number%[(, | (with|and) ) [max[imum] [value]] %number%[(, | (with|and) ) [def[ault] [value]] %number%[(, | (with|and) ) [[step] [value]] %number%]]]]
A slider with a selection of values

Creates an element similar to the numeric slider, but with text values. Allows you to specify the initial value by index.

form(-| )(text|step)[(-| )]slider (with name|named) %string% (with|and) [elements] %strings%[(, | (with|and) ) [def[ault] [(element [index]|index)]] %number%]
The switch element.

It has only two states, on or off. You can specify the initial state.

form(-| )toggle (with name|named) %string% [(with|and) [def[ault]] [value] %boolean%]

Processing the results

Get the player inside the form

Use this expression to get the player inside the form, instead of the usual player or any variables.

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 name of player what close form
open last created form to player

Cancel or allow closing of the form

By default, closing the form is allowed. If you disable it, the form will be reopened after the selection

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 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 when the form is successfully closed

[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 button creation section