Skip to main content

Creating Toggles

Creation Snippet

local Toggle = Groupbox:CreateToggle({
Name = "Toggle",
CurrentValue = false,
Style = 2,
Callback = function(Value)

end,
}, "INDEX")

This is just a snippet, not all parameters are included
Replace INDEX with a unique identifier of the instance that is not repeated.

Parameters

Name : string
The Text that shows in the button.

Tooltip : string NOT REQUIRED
A Description that shows up after hovering over the element after a short amount of time.

Icon : number NOT REQUIRED
The Icon that shows up next to the title.

Callback : function
The function that executes when the toggle is well, toggled.
Passed Parameters:

  • Value : boolean
    The Current Value of the Toggle.

Style : number NOT REQUIRED
The Style of the Toggle. Current Styles : 1,2. (Checkbox, Switch)
Screenshots will be provided soon.

CurrentValue : boolean
The Current Value of the Element. For toggles, its whether its enabled or not.

CheckboxIcon : number REQUIRES STYLE 1
The Icon that shows in the checkbox.