The Toggle Switch is located under the Input Controls in the Controls list. A toggled event can be created for it, which is always executed when the position of the switch changes. To check in a script whether the toggle switch is activated or not, the respective control must be given a name to query the Boolean ‘IsOn’. This is ‘true’ if the toggle switch is activated and ‘false’ if it is deactivated. You can also specify the text above the toggle switch and the text for the positions ‘activated’ and ‘deactivated’. This can be set in the properties of the respective control.
Further information on how to create scripts or how the Script-Editor works can be found in the Scripting section.