💣
idontgiveaf's fluent gui
  • Fluent Library
    • Example Script
  • Fluent
    • Setup
      • Interface and Save Manager
      • Properties
  • Components
    • Window
      • Tabs
      • Dialog
  • elements
    • Guide
      • Destroying Elements
      • Section
      • Paragraphs
      • Buttons
      • Toggles
      • Sliders
      • Inputs
      • Dropdowns
      • Colorpickers
      • Keybinds
Powered by GitBook
On this page
  1. elements
  2. Guide

Toggles

To create a toggle, use this.

local Toggle = Tabs.Main:AddToggle("MyToggle", 
{
    Title = "Toggle", 
    Description = "Toggle description",
    Default = false,
    Callback = function(state)
	if state then
	    print("Toggle On")
	else
	    print("Toggle Off")
        end
    end 
})

If you are having issues, you're supposed to replace "Tabs.Main" with your actual tab.

Example: "Tabs.Exploits"

Whatever you put in your Tabs variable, it's what you need.

Change local Toggle to a different variable name every time. It can be anything.

MyToggle (name of toggle) is saved in the Options variable.

You can try to remove it, but I've never tried to.

You can get the value anywhere simply by using this: (Put your variable name)

Toggle.Value

Toggle.Value has not been tested by me and may not work. You can try the one below.

Or, whatever you put as the name of the toggle.

Options.MyToggle.Value

Functions

You can check when the toggle is changed, but Callback does the same thing.

Toggle:OnChanged(function()
    print("Toggle changed:", Options.MyToggle.Value)
end)

To set the value of the toggle, use this.

Toggle:SetValue(false)

If you don't set the right variable name, it won't work.

PreviousButtonsNextSliders

Last updated 5 months ago