local tab = api.ui.tab("My Script", "pencil")
local section = tab:AddSection("General", 1)
local enabled = section:AddToggle("enabled", "Enabled", false)
local color = section:AddColorpicker("color", "Color", Color3.fromRGB(255, 100, 100), 0)
-- Run something when the toggle changes
enabled:OnChange(function(on)
print("toggled:", on)
end)
-- Run something every time the displayed color changes (including animation)
color:OnUpdate(function(snap)
-- snap.color is the current Color3
end)
-- Run something when your script is unloaded
api.onUnload(function()
print("cleaning up", api.name)
end)