Loads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: github.com, raw.githubusercontent.com, lucide.dev.
About this script
Obsidian Ui Lib
Not Mine
The Repo Can Be Found Here: https://github.com/deividcomsono/Obsidian
-- Make toggle keybinds work inside the keybinds UI (aka adds a toggle to the UI). Good for mobile users (Default value = true)
local
CreateWindow
-- Set Center to true if you want the menu to appear in the center
-- Set AutoShow to true if you want the menu to appear when it is created
-- Set Resizable to true if you want to have in-game resizable Window
-- Set MobileButtonsSide to "Left" or "Right" if you want the ui toggle & lock buttons to be on the left or right side of the window
-- Set ShowCustomCursor to false if you don't want to use the Linoria cursor
-- NotifySide = Changes the side of the notifications (Left, Right) (Default value = Left)
-- Position and Size are also valid options here
-- but you do not need to define them unless you are changing them :)
"mspaint"
"version: example"
95816097006870
"Right"
true
-- CALLBACK NOTE:
-- Passing in callback functions via the initial element parameters (i.e. Callback = function(Value)...) works
-- HOWEVER, using Toggles/Options.INDEX:OnChanged(function(Value) ... ) is the RECOMMENDED way to do this.
-- I strongly recommend decoupling UI code from logic code. i.e. Create your UI elements FIRST, and THEN setup :OnChanged functions later.
-- You do not have to set your tabs & groups up this way, just a prefrence.
-- You can find more icons in https://lucide.dev/
local
-- Creates a new tab titled Main
AddTab
"Main"
"user"
AddKeyTab
"Key System"
"UI Settings"
AddTab
"UI Settings"
"settings"
--[[
Example of how to add a warning box to a tab; the title AND text support rich text formatting.
local WarningTab = Tabs["UI Settings"]:AddTab("Warning Box", "user")
WarningTab:UpdateWarningBox({
Visible = true,
Title = "Warning",
Text = "This is a warning box!",
})
]]
-- Groupbox and Tabbox inherit the same functions
-- except Tabboxes you have to call the functions on a tab (Tabbox:AddTab(Name))
local
AddLeftGroupbox
"Groupbox"
"boxes"
-- We can also get our Main tab via the following code:
-- local LeftGroupBox = Window.Tabs.Main:AddLeftGroupbox("Groupbox", "boxes")
-- Tabboxes are a tiny bit different, but here's a basic example:
--[[
local TabBox = Tabs.Main:AddLeftTabbox() -- Add Tabbox on left side
local Tab1 = TabBox:AddTab("Tab 1")
local Tab2 = TabBox:AddTab("Tab 2")
-- You can now call AddToggle, etc on the tabs you added to the Tabbox
]]
-- Groupbox:AddToggle
-- Arguments: Index, Options
AddToggle
"MyToggle"
"This is a toggle"
"This is a tooltip"
-- Information shown when you hover over the toggle
"I am disabled!"
-- Information shown when you hover over the toggle while it's disabled
true
-- Default value (true / false)
false
-- Will disable the toggle (true / false)
true
-- Will make the toggle invisible (true / false)
false
-- Makes the text red (the color can be changed using Library.Scheme.Red) (Default value = false)
function
print
"[cb] MyToggle changed to:"
end
AddColorPicker
"ColorPicker1"
Color3
new
1
0
0
"Some color1"
-- Optional. Allows you to have a custom color picker title (when you open it)
0
-- Optional. Enables transparency changing for this color picker (leave as nil to disable)
function
print
"[cb] Color changed!"
end
AddColorPicker
"ColorPicker2"
Color3
new
0
1
0
"Some color2"
function
print
"[cb] Color changed!"
end
-- Fetching a toggle object for later use:
-- Toggles.MyToggle.Value
-- Toggles is a table added to getgenv() by the library
-- You index Toggles with the specified index, in this case it is 'MyToggle'
-- To get the state of the toggle you do toggle.Value
-- Calls the passed function when the toggle is updated
OnChanged
function
-- here we get our toggle object & then get its value
print
"MyToggle changed to:"
end
-- This should print to the console: "My toggle state changed! New value: false"
SetValue
false
AddCheckbox
"MyCheckbox"
"This is a checkbox"
"This is a tooltip"
-- Information shown when you hover over the toggle
"I am disabled!"
-- Information shown when you hover over the toggle while it's disabled
true
-- Default value (true / false)
false
-- Will disable the toggle (true / false)
true
-- Will make the toggle invisible (true / false)
false
-- Makes the text red (the color can be changed using Library.Scheme.Red) (Default value = false)
function
print
"[cb] MyCheckbox changed to:"
end
OnChanged
function
print
"MyCheckbox changed to:"
end
-- 1/15/23
-- Deprecated old way of creating buttons in favor of using a table
-- Added DoubleClick button functionality
--[[
Groupbox:AddButton
Arguments: {
Text = string,
Func = function,
DoubleClick = boolean
Tooltip = string,
}
You can call :AddButton on a button to add a SubButton!
]]
local
AddButton
"Button"
function
print
"You clicked a button!"
end
false
"This is the main button"
"I am disabled!"
false
-- Will disable the button (true / false)
true
-- Will make the button invisible (true / false)
false
-- Makes the text red (the color can be changed using Library.Scheme.Red) (Default value = false)
local
AddButton
"Sub button"
function
print
"You clicked a sub button!"
end
true
-- You will have to click this button twice to trigger the callback
"This is the sub button"
"I am disabled!"
local
AddButton
"Disabled Button"
function
print
"You somehow clicked a disabled button!"
end
false
"This is a disabled button"
"I am disabled!"
-- Information shown when you hover over the button while it's disabled
true
--[[
NOTE: You can chain the button methods!
EXAMPLE:
LeftGroupBox:AddButton({ Text = 'Kill all', Func = Functions.KillAll, Tooltip = 'This will kill everyone in the game!' })
:AddButton({ Text = 'Kick all', Func = Functions.KickAll, Tooltip = 'This will kick everyone in the game!' })
]]
-- Groupbox:AddLabel
-- Arguments: Text, DoesWrap, Idx
-- Arguments: Idx, Options
AddLabel
"This is a label"
AddLabel
"This is a label\n\nwhich wraps its text!"
true
AddLabel
"This is a label exposed to Labels"
true
"TestLabel"
AddLabel
"SecondTestLabel"
"This is a label made with table options and an index"
true
-- Defaults to false
AddLabel
"SecondTestLabel"
"This is a label that doesn't wrap it's own text"
false
-- Defaults to false
-- Options is a table added to getgenv() by the library
-- You index Options with the specified index, in this case it is 'SecondTestLabel' & 'TestLabel'
-- To set the text of the label you do label:SetText
--[[
Groupbox:AddSlider
Arguments: Idx, SliderOptions
SliderOptions: {
Text = string,
Default = number,
Min = number,
Max = number,
Suffix = string,
Rounding = number,
Compact = boolean,
HideMax = boolean,
}
Text, Default, Min, Max, Rounding must be specified.
Suffix is optional.
Rounding is the number of decimal places for precision.
Compact will hide the title label of the Slider
HideMax will only display the value instead of the value & max value of the slider
Compact will do the same thing
]]
AddSlider
"MySlider"
"This is my slider!"
0
0
5
1
false
function
print
"[cb] MySlider was changed! New value:"
end
"I am a slider!"
-- Information shown when you hover over the slider
"I am disabled!"
-- Information shown when you hover over the slider while it's disabled
false
-- Will disable the slider (true / false)
true
-- Will make the slider invisible (true / false)
-- Options is a table added to getgenv() by the library
-- You index Options with the specified index, in this case it is 'MySlider'
-- To get the value of the slider you do slider.Value
local
OnChanged
function
print
"MySlider was changed! New value:"
end
-- This should print to the console: "MySlider was changed! New value: 3"
SetValue
3
-- Groupbox:AddInput
-- Arguments: Idx, Info
AddInput
"MyTextbox"
"My textbox!"
false
-- true / false, only allows numbers
false
-- true / false, only calls callback when you press enter
true
-- true / false, if false the text will not clear when textbox focused
"This is a textbox"
"This is a tooltip"
-- Information shown when you hover over the textbox
"Placeholder text"
-- placeholder text when the box is empty
-- MaxLength is also an option which is the max length of the text
function
print
"[cb] Text updated. New text:"
end
OnChanged
function
print
"Text updated. New text:"
end
-- Groupbox:AddDropdown
-- Arguments: Idx, Info
local
AddRightGroupbox
"Dropdowns"
AddDropdown
"MyDropdown"
"This"
"is"
"a"
"dropdown"
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
"A dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
false
-- true / false, makes the dropdown searchable (great for a long list of values)
function
print
"[cb] Dropdown got changed. New value:"
end
false
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
OnChanged
function
print
"Dropdown got changed. New value:"
end
SetValue
"This"
AddDropdown
"MySearchableDropdown"
"This"
"is"
"a"
"searchable"
"dropdown"
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
"A searchable dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
true
-- true / false, makes the dropdown searchable (great for a long list of values)
function
print
"[cb] Dropdown got changed. New value:"
end
false
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
AddDropdown
"MyDisplayFormattedDropdown"
"This"
"is"
"a"
"formatted"
"dropdown"
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
"A display formatted dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
function
-- You can change the display value for any values. The value will be still same, only the UI changes.
if
"formatted"
then
return
"display formatted"
-- formatted -> display formatted but in Options.MyDisplayFormattedDropdown.Value it will still return formatted if its selected.
end
return
end
false
-- true / false, makes the dropdown searchable (great for a long list of values)
function
print
"[cb] Display formatted dropdown got changed. New value:"
end
false
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
-- Multi dropdowns
AddDropdown
"MyMultiDropdown"
-- Default is the numeric index (e.g. "This" would be 1 since it if first in the values list)
-- Default also accepts a string as well
-- Currently you can not set multiple values with a dropdown
"This"
"is"
"a"
"dropdown"
1
true
-- true / false, allows multiple choices to be selected
"A multi dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
function
print
"[cb] Multi dropdown got changed:"
for
in
next
do
print
-- should print something like This, true
end
end
SetValue
true
true
AddDropdown
"MyDisabledDropdown"
"This"
"is"
"a"
"dropdown"
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
"A disabled dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
function
print
"[cb] Disabled dropdown got changed. New value:"
end
true
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
AddDropdown
"MyDisabledValueDropdown"
"This"
"is"
"a"
"dropdown"
"with"
"disabled"
"value"
"disabled"
-- Disabled Values that are unclickable
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
"A dropdown with disabled value"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
function
print
"[cb] Dropdown with disabled value got changed. New value:"
end
false
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
AddDropdown
"MyVeryLongDropdown"
"This"
"is"
"a"
"very"
"long"
"dropdown"
"with"
"a"
"lot"
"of"
"values"
"but"
"you"
"can"
"see"
"more"
"than"
"8"
"values"
1
-- number index of the value / string
false
-- true / false, allows multiple choices to be selected
12
-- Default: 8, allows you to change the size of the dropdown list
"A very long dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
"I am disabled!"
-- Information shown when you hover over the dropdown while it's disabled
false
-- true / false, makes the dropdown searchable (great for a long list of values)
function
print
"[cb] Very long dropdown got changed. New value:"
end
false
-- Will disable the dropdown (true / false)
true
-- Will make the dropdown invisible (true / false)
AddDropdown
"MyPlayerDropdown"
"Player"
true
-- true / false, excludes the localplayer from the Player type
"A player dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
function
print
"[cb] Player dropdown got changed:"
end
AddDropdown
"MyTeamDropdown"
"Team"
"A team dropdown"
"This is a tooltip"
-- Information shown when you hover over the dropdown
function
print
"[cb] Team dropdown got changed:"
end
-- Label:AddColorPicker
-- Arguments: Idx, Info
-- You can also ColorPicker & KeyPicker to a Toggle as well
AddLabel
"Color"
AddColorPicker
"ColorPicker"
Color3
new
0
1
0
-- Bright green
"Some color"
-- Optional. Allows you to have a custom color picker title (when you open it)
0
-- Optional. Enables transparency changing for this color picker (leave as nil to disable)
function
print
"[cb] Color changed!"
end
OnChanged
function
print
"Color changed!"
print
"Transparency changed!"
end
SetValueRGB
Color3
fromRGB
0
255
140
-- Label:AddKeyPicker
-- Arguments: Idx, Info
AddLabel
"Keybind"
AddKeyPicker
"KeyPicker"
-- SyncToggleState only works with toggles.
-- It allows you to make a keybind which has its state synced with its parent toggle
-- Example: Keybind which you use to toggle flyhack, etc.
-- Changing the toggle disables the keybind state and toggling the keybind switches the toggle state
"MB2"
-- String as the name of the keybind (MB1, MB2 for mouse buttons)
false
-- You can define custom Modes but I have never had a use for it.
"Toggle"
-- Modes: Always, Toggle, Hold
"Auto lockpick safes"
-- Text to display in the keybind menu
false
-- Set to true if you want to hide from the Keybind menu,
-- Occurs when the keybind is clicked, Value is `true`/`false`
function
print
"[cb] Keybind clicked!"
end
-- Occurs when the keybind itself is changed, `New` is a KeyCode Enum OR a UserInputType Enum
function
print
"[cb] Keybind changed!"
end
-- OnClick is only fired when you press the keybind and the mode is Toggle
-- Otherwise, you will have to use Keybind:GetState()
OnClick
function
print
"Keybind clicked!"
GetState
end
OnChanged
function
print
"Keybind changed!"
end
task
spawn
function
while
true
do
wait
1
-- example for checking if a keybind is being pressed
local
GetState
if
then
print
"KeyPicker is being held down"
end
if
then
break
end
end
end
SetValue
"MB2"
"Hold"
-- Sets keybind to MB2, mode to Hold
-- Long text label to demonstrate UI scrolling behaviour.
local
AddLeftGroupbox
"Groupbox #2"
AddLabel
"This label spans multiple lines! We're gonna run out of UI space...\nJust kidding! Scroll down!\n\n\nHello from below!"
true
local
AddRightTabbox
-- Add Tabbox on right side
-- Anything we can do in a Groupbox, we can do in a Tabbox tab (AddToggle, AddSlider, AddLabel, etc etc...)
local
AddTab
"Tab 1"
AddToggle
"Tab1Toggle"
"Tab1 Toggle"
local
AddTab
"Tab 2"
AddToggle
"Tab2Toggle"
"Tab2 Toggle"
OnUnload
function
print
"Unloaded!"
end
-- Anything we can do in a Groupbox, we can do in a Key tab (AddToggle, AddSlider, AddLabel, etc etc...)
AddLabel
"Key: Banana"
true
16
AddKeyBox
"Banana"
function
print
"Expected Key: Banana - Received Key:"
"| Success:"
Notify
"Expected Key: Banana"
"Received Key: "
"\nSuccess: "
tostring
4
end
AddLabel
"No Key"
true
16
AddKeyBox
function
print
"Expected Key: None | Success:"
-- true
Notify
"Success: "
tostring
4
end
-- UI Settings
local
"UI Settings"
AddLeftGroupbox
"Menu"
"wrench"
AddToggle
"KeybindMenuOpen"
"Open Keybind Menu"
function
end
AddToggle
"ShowCustomCursor"
"Custom Cursor"
true
function
end
AddDropdown
"NotificationSide"
"Left"
"Right"
"Right"
"Notification Side"
function
SetNotifySide
end
AddDropdown
"DPIDropdown"
"50%"
"75%"
"100%"
"125%"
"150%"
"175%"
"200%"
"100%"
"DPI Scale"
function
gsub
"%%"
""
local
tonumber
SetDPIScale
end
AddDivider
AddLabel
"Menu bind"
AddKeyPicker
"MenuKeybind"
"RightShift"
true
"Menu keybind"
AddButton
"Unload"
function
Unload
end
-- Allows you to have a custom keybind for the menu
-- Addons:
-- SaveManager (Allows you to have a configuration system)
-- ThemeManager (Allows you to have a menu theme system)
-- Hand the library over to our managers
SetLibrary
SetLibrary
-- Ignore keys that are used by ThemeManager.
-- (we dont want configs to save themes, do we?)
IgnoreThemeSettings
-- Adds our MenuKeybind to the ignore list
-- (do you want each config to have a different menu key? probably not.)
SetIgnoreIndexes
"MenuKeybind"
-- use case for doing it this way:
-- a script hub could have themes in a global folder
-- and game configs in a separate folder per game
SetFolder
"MyScriptHub"
SetFolder
"MyScriptHub/specific-game"
SetSubFolder
"specific-place"
-- if the game has multiple places inside of it (for example: DOORS)
-- you can use this to save configs for those places separately
-- The path in this script would be: MyScriptHub/specific-game/settings/specific-place
-- [ This is optional ]
-- Builds our config menu on the right side of our tab
BuildConfigSection
"UI Settings"
-- Builds our theme menu (with plenty of built in themes) on the left side
-- NOTE: you can also call ThemeManager:ApplyToGroupbox to add it to a specific groupbox
ApplyToTab
"UI Settings"
-- You can use the SaveManager:LoadAutoloadConfig() to load a config
-- which has been marked to be one that auto loads!