dialog refers to the return value of Dialog:Create
Checkbox
dialog:AddCheckbox creates a new color input field.
Parameters
dialog:AddCheckbox(label, description?, defaultValue?, required?)| Name | Type | Description | Required |
|---|---|---|---|
| label | string | The title of the input | Yes |
| description | string | The description of the input field | No |
| defaultValue | boolean | The default value of the input field | No |
| required | boolean | If the value of the field should be valid and required | No |
Example
client/example.lua
local dialog = Dialog:Create('Title');
dialog:AddCheckbox('Checkbox', 'Are cats cool?', true, true --[[Ensures that the box is checked]]);
local results = dialog:Open();
print(results[1]) -- If the box is checked or not