Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- start of ui library
- if getgenv().loaded then
- getgenv().library:unload_menu()
- end
- getgenv().loaded = true
- -- variables
- local uis = cloneref(game:GetService("UserInputService"))
- local players = cloneref(game:GetService("Players"))
- local ws = cloneref(game:GetService("Workspace"))
- local rs = cloneref(game:GetService("ReplicatedStorage"))
- local http_service = cloneref(game:GetService("HttpService"))
- local gui_service = cloneref(game:GetService("GuiService"))
- local lighting = cloneref(game:GetService("Lighting"))
- local run = cloneref(game:GetService("RunService"))
- local stats = cloneref(game:GetService("Stats"))
- local coregui = cloneref(game:GetService("CoreGui"))
- local debris = cloneref(game:GetService("Debris"))
- local tween_service = cloneref(game:GetService("TweenService"))
- local sound_service = cloneref(game:GetService("SoundService"))
- local vec2 = Vector2.new
- local vec3 = Vector3.new
- local dim2 = UDim2.new
- local dim = UDim.new
- local rect = Rect.new
- local cfr = CFrame.new
- local empty_cfr = cfr()
- local point_object_space = empty_cfr.PointToObjectSpace
- local angle = CFrame.Angles
- local dim_offset = UDim2.fromOffset
- local color = Color3.new
- local rgb = Color3.fromRGB
- local hex = Color3.fromHex
- local hsv = Color3.fromHSV
- local rgbseq = ColorSequence.new
- local rgbkey = ColorSequenceKeypoint.new
- local numseq = NumberSequence.new
- local numkey = NumberSequenceKeypoint.new
- local camera = ws.CurrentCamera
- local lp = players.LocalPlayer
- local mouse = lp:GetMouse()
- local gui_offset = gui_service:GetGuiInset().Y
- local max = math.max
- local floor = math.floor
- local min = math.min
- local abs = math.abs
- local noise = math.noise
- local rad = math.rad
- local random = math.random
- local pow = math.pow
- local sin = math.sin
- local pi = math.pi
- local tan = math.tan
- local atan2 = math.atan2
- local clamp = math.clamp
- local insert = table.insert
- local find = table.find
- local remove = table.remove
- local concat = table.concat
- --
- -- Library init
- getgenv().library = {
- directory = "ecstasy",
- folders = {
- "/fonts",
- "/configs",
- },
- flags = {},
- config_flags = {},
- connections = {},
- notifications = {notifs = {}, offset = 0},
- playerlist_data = {
- players = {},
- player = {},
- },
- colorpicker_open = false;
- gui;
- }
- local themes = {
- preset = {
- accent = rgb(255, 0, 0),
- text = rgb(255, 255, 255),
- text_outline = rgb(0, 0, 0),
- },
- utility = {
- accent = {
- BackgroundColor3 = {},
- TextColor3 = {},
- ImageColor3 = {},
- ScrollBarImageColor3 = {}
- },
- text = {
- TextColor3 = {}
- },
- text_outline = {
- Color = {}
- }
- }
- }
- local keys = {
- [Enum.KeyCode.LeftShift] = "LS",
- [Enum.KeyCode.RightShift] = "RS",
- [Enum.KeyCode.LeftControl] = "LC",
- [Enum.KeyCode.RightControl] = "RC",
- [Enum.KeyCode.Insert] = "INS",
- [Enum.KeyCode.Backspace] = "BS",
- [Enum.KeyCode.Return] = "Ent",
- [Enum.KeyCode.LeftAlt] = "LA",
- [Enum.KeyCode.RightAlt] = "RA",
- [Enum.KeyCode.CapsLock] = "CAPS",
- [Enum.KeyCode.One] = "1",
- [Enum.KeyCode.Two] = "2",
- [Enum.KeyCode.Three] = "3",
- [Enum.KeyCode.Four] = "4",
- [Enum.KeyCode.Five] = "5",
- [Enum.KeyCode.Six] = "6",
- [Enum.KeyCode.Seven] = "7",
- [Enum.KeyCode.Eight] = "8",
- [Enum.KeyCode.Nine] = "9",
- [Enum.KeyCode.Zero] = "0",
- [Enum.KeyCode.KeypadOne] = "Num1",
- [Enum.KeyCode.KeypadTwo] = "Num2",
- [Enum.KeyCode.KeypadThree] = "Num3",
- [Enum.KeyCode.KeypadFour] = "Num4",
- [Enum.KeyCode.KeypadFive] = "Num5",
- [Enum.KeyCode.KeypadSix] = "Num6",
- [Enum.KeyCode.KeypadSeven] = "Num7",
- [Enum.KeyCode.KeypadEight] = "Num8",
- [Enum.KeyCode.KeypadNine] = "Num9",
- [Enum.KeyCode.KeypadZero] = "Num0",
- [Enum.KeyCode.Minus] = "-",
- [Enum.KeyCode.Equals] = "=",
- [Enum.KeyCode.Tilde] = "~",
- [Enum.KeyCode.LeftBracket] = "[",
- [Enum.KeyCode.RightBracket] = "]",
- [Enum.KeyCode.RightParenthesis] = ")",
- [Enum.KeyCode.LeftParenthesis] = "(",
- [Enum.KeyCode.Semicolon] = ",",
- [Enum.KeyCode.Quote] = "'",
- [Enum.KeyCode.BackSlash] = "\\",
- [Enum.KeyCode.Comma] = ",",
- [Enum.KeyCode.Period] = ".",
- [Enum.KeyCode.Slash] = "/",
- [Enum.KeyCode.Asterisk] = "*",
- [Enum.KeyCode.Plus] = "+",
- [Enum.KeyCode.Period] = ".",
- [Enum.KeyCode.Backquote] = "`",
- [Enum.UserInputType.MouseButton1] = "MB1",
- [Enum.UserInputType.MouseButton2] = "MB2",
- [Enum.UserInputType.MouseButton3] = "MB3",
- [Enum.KeyCode.Escape] = "ESC",
- [Enum.KeyCode.Space] = "SPC",
- }
- library.__index = library
- for _, path in next, library.folders do
- makefolder(library.directory .. path)
- end
- local flags = library.flags
- local config_flags = library.config_flags
- local fonts = {}; do
- function Register_Font(Name, Weight, Style, Asset)
- if not isfile(Asset.Id) then
- writefile(Asset.Id, Asset.Font)
- end
- if isfile(Name .. ".font") then
- delfile(Name .. ".font")
- end
- local Data = {
- name = Name,
- faces = {
- {
- name = "Normal",
- weight = Weight,
- style = Style,
- assetId = getcustomasset(Asset.Id),
- },
- },
- }
- writefile(Name .. ".font", http_service:JSONEncode(Data))
- return getcustomasset(Name .. ".font");
- end
- local ProggyTiny = Register_Font("adwdawdwadadwadawdawdawdawd!", 100, "Normal", {
- Id = "ProggyTinyyyy.ttf",
- Font = game:HttpGet("https://github.com/i77lhm/storage/raw/refs/heads/main/fonts/ProggyTiny.ttf"),
- })
- fonts = {
- main = Font.new(ProggyTiny, Enum.FontWeight.Regular, Enum.FontStyle.Normal);
- }
- end
- --
- -- Library functions
- -- Misc functions
- function library:tween(obj, properties)
- local tween = tween_service:Create(obj, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0), properties):Play()
- return tween
- end
- function library:next_flag()
- local idx = #self.flags + 1
- return string.format("flag_%s", idx);
- end
- function library:resizify(frame)
- local Frame = Instance.new("TextButton")
- Frame.Position = dim2(1, -10, 1, -10)
- Frame.BorderColor3 = rgb(0, 0, 0)
- Frame.Size = dim2(0, 10, 0, 10)
- Frame.BorderSizePixel = 0
- Frame.BackgroundColor3 = rgb(255, 255, 255)
- Frame.Parent = frame
- Frame.BackgroundTransparency = 1
- Frame.Text = ""
- local resizing = false
- local start_size
- local start
- local og_size = frame.Size
- Frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- resizing = true
- start = input.Position
- start_size = frame.Size
- end
- end)
- Frame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- resizing = false
- end
- end)
- library:connection(uis.InputChanged, function(input, game_event)
- if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then
- local viewport_x = camera.ViewportSize.X
- local viewport_y = camera.ViewportSize.Y
- local current_size = dim2(
- start_size.X.Scale,
- math.clamp(
- start_size.X.Offset + (input.Position.X - start.X),
- og_size.X.Offset,
- viewport_x
- ),
- start_size.Y.Scale,
- math.clamp(
- start_size.Y.Offset + (input.Position.Y - start.Y),
- og_size.Y.Offset,
- viewport_y
- )
- )
- frame.Size = current_size
- end
- end)
- end
- function library:mouse_in_frame(uiobject)
- local y_cond = uiobject.AbsolutePosition.Y <= mouse.Y and mouse.Y <= uiobject.AbsolutePosition.Y + uiobject.AbsoluteSize.Y
- local x_cond = uiobject.AbsolutePosition.X <= mouse.X and mouse.X <= uiobject.AbsolutePosition.X + uiobject.AbsoluteSize.X
- return (y_cond and x_cond)
- end
- function library:draggify(frame)
- local dragging = false
- local start_size = frame.Position
- local start
- frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- start = input.Position
- start_size = frame.Position
- end
- end)
- frame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- library:connection(uis.InputChanged, function(input, game_event)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local viewport_x = camera.ViewportSize.X
- local viewport_y = camera.ViewportSize.Y
- local current_position = dim2(
- 0,
- clamp(
- start_size.X.Offset + (input.Position.X - start.X),
- 0,
- viewport_x - frame.Size.X.Offset
- ),
- 0,
- math.clamp(
- start_size.Y.Offset + (input.Position.Y - start.Y),
- 0,
- viewport_y - frame.Size.Y.Offset
- )
- )
- frame.Position = current_position
- end
- end)
- end
- function library:convert(str)
- local values = {}
- for value in string.gmatch(str, "[^,]+") do
- insert(values, tonumber(value))
- end
- if #values == 4 then
- return unpack(values)
- else
- return
- end
- end
- function library:convert_enum(enum)
- local enum_parts = {}
- for part in string.gmatch(enum, "[%w_]+") do
- insert(enum_parts, part)
- end
- local enum_table = Enum
- for i = 2, #enum_parts do
- local enum_item = enum_table[enum_parts[i]]
- enum_table = enum_item
- end
- return enum_table
- end
- local config_holder;
- local cfg_name;
- function library:update_config_list()
- if not config_holder then
- return
- end
- local list = {}
- for idx, file in next, listfiles(library.directory .. "/configs") do
- local name = file:gsub(library.directory .. "/configs\\", ""):gsub(".cfg", ""):gsub(library.directory .. "\\configs\\", "")
- list[#list + 1] = name
- end
- config_holder.refresh_options(list)
- end
- function library:get_config()
- local Config = {}
- for _, v in next, flags do
- if type(v) == "table" and v.key then
- Config[_] = {active = v.active, mode = v.mode, key = tostring(v.key)}
- elseif type(v) == "table" and v["Transparency"] and v["Color"] then
- Config[_] = {Transparency = v["Transparency"], Color = v["Color"]:ToHex()}
- else
- Config[_] = v
- end
- end
- return http_service:JSONEncode(Config)
- end
- function library:load_config(config_json)
- local config = http_service:JSONDecode(config_json)
- for _, v in next, config do
- local function_set = library.config_flags[_]
- if _ == "config_name_list" then
- continue
- end
- if function_set then
- if type(v) == "table" and v["Transparency"] and v["Color"] then
- function_set(hex(v["Color"]), v["Transparency"])
- elseif type(v) == "table" and v["active"] then
- function_set(v)
- else
- function_set(v)
- end
- end
- end
- end
- function library:round(number, float)
- local multiplier = 1 / (float or 1)
- return floor(number * multiplier + 0.5) / multiplier
- end
- function library:apply_theme(instance, theme, property)
- insert(themes.utility[theme][property], instance)
- end
- function library:update_theme(theme, color)
- for _, property in themes.utility[theme] do
- for m, object in property do
- if object[_] == themes.preset[theme] then
- object[_] = color
- end
- end
- end
- themes.preset[theme] = color
- end
- function library:connection(signal, callback)
- local connection = signal:Connect(callback)
- insert(library.connections, connection)
- return connection
- end
- function library:apply_stroke(parent)
- local STROKE = library:create("UIStroke", {
- Parent = parent,
- Color = themes.preset.text_outline,
- LineJoinMode = Enum.LineJoinMode.Miter
- })
- library:apply_theme(STROKE, "text_outline", "Color")
- end
- function library:create(instance, options)
- local ins = Instance.new(instance)
- for prop, value in options do
- ins[prop] = value
- end
- if instance == "TextLabel" or instance == "TextButton" or instance == "TextBox" then
- library:apply_theme(ins, "text", "TextColor3")
- end
- return ins
- end
- function library:unload_menu()
- if library[ "items" ] then
- library[ "items" ]:Destroy()
- end
- if library[ "other" ] then
- library[ "other" ]:Destroy()
- end
- for index, connection in library.connections do
- connection:Disconnect()
- connection = nil
- end
- library = nil
- end
- function library:change_fontsize(int)
- for _, property in themes.utility.text do
- for m, object in property do
- object.TextSize = int -- triangle code
- end
- end
- end
- --
- -- Library element functions
- function library:window(properties)
- local cfg = {
- name = properties.name or properties.Name or '<font color = "#FFFFFF">chud</font>vision<font color = "#FFFFFF">.net</font>';
- size = properties.size or properties.Size or dim2(0, 752, 0, 502);
- selected_tab;
- items = {};
- }
- library[ "items" ] = library:create( "ScreenGui" , {
- Parent = coregui;
- Name = "\0";
- Enabled = true;
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
- IgnoreGuiInset = true;
- });
- library[ "other" ] = library:create( "ScreenGui" , {
- Parent = coregui;
- Name = "\0";
- Enabled = true;
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
- IgnoreGuiInset = true;
- });
- local items = cfg.items; do
- items[ "main" ] = library:create( "Frame" , {
- Parent = library[ "items" ];
- Name = "\0";
- Position = dim2(0.5, -cfg.size.X.Offset / 2, 0.5, -cfg.size.Y.Offset / 2);
- BorderColor3 = rgb(0, 0, 0);
- Size = cfg.size;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- }); items[ "main" ].Position = dim2(0, items[ "main" ].AbsolutePosition.X, 0, items[ "main" ].AbsolutePosition.Y)
- items[ "tab_element_holder" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = items[ "main" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 82, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- });
- items[ "tab_buttons" ] = library:create( "Frame" , {
- Parent = items[ "tab_element_holder" ];
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- items[ "tab_holder" ] = library:create( "Frame" , {
- Parent = items[ "tab_buttons" ];
- Name = "\0";
- BackgroundTransparency = 1;
- ClipsDescendants = true;
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, 0);
- Position = dim2(0, 0, 0, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIListLayout" , {
- Parent = items[ "tab_holder" ];
- Padding = dim(0, 15);
- SortOrder = Enum.SortOrder.LayoutOrder
- });
- library:create( "UIPadding" , {
- Parent = items[ "tab_holder" ];
- PaddingTop = dim(0, 10)
- });
- end
- do -- Other
- library:draggify(items[ "main" ])
- library:resizify(items[ "main" ])
- end
- -- Keybind list
- cfg.keybind_list = library:create("Frame", {
- BorderColor3 = rgb(0, 0, 0);
- Parent = library[ "other" ];
- BackgroundTransparency = 1;
- Position = dim2(0, 100, 0, 600);
- Size = dim2(0, 202, 0, 66);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(255, 255, 255)
- }); library:resizify(cfg.keybind_list); library:draggify(cfg.keybind_list);
- library:create("UIStroke", {
- Parent = cfg.keybind_list;
- LineJoinMode = Enum.LineJoinMode.Miter;
- Transparency = 1;
- });
- local inline1 = library:create("Frame", {
- BorderColor3 = rgb(0, 0, 0);
- Parent = cfg.keybind_list;
- BackgroundTransparency = 1;
- Position = dim2(0, 1, 0, 1);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(56, 56, 56)
- });
- library:create("UIStroke", {
- Color = rgb(56, 56, 56);
- LineJoinMode = Enum.LineJoinMode.Miter;
- Parent = inline1;
- Transparency = 1
- });
- local inline2 = library:create("Frame", {
- BorderColor3 = rgb(0, 0, 0);
- Parent = inline1;
- BackgroundTransparency = 1;
- Position = dim2(0, 1, 0, 1);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(46, 46, 46)
- });
- library:create("UIStroke", {
- Color = rgb(46, 46, 46);
- LineJoinMode = Enum.LineJoinMode.Miter;
- Parent = inline2;
- Transparency = 1
- });
- local inline3 = library:create("Frame", {
- BorderColor3 = rgb(0, 0, 0);
- Parent = inline2;
- BackgroundTransparency = 1;
- Position = dim2(0, 1, 0, 1);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(46, 46, 46)
- });
- library:create("UIStroke", {
- Color = rgb(46, 46, 46);
- LineJoinMode = Enum.LineJoinMode.Miter;
- Parent = inline3;
- Transparency = 1
- });
- local inline4 = library:create("Frame", {
- BorderColor3 = rgb(0, 0, 0);
- Parent = inline3;
- BackgroundTransparency = 1;
- Position = dim2(0, 1, 0, 1);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(46, 46, 46)
- });
- library:create("UIStroke", {
- Color = rgb(56, 56, 56);
- LineJoinMode = Enum.LineJoinMode.Miter;
- Parent = inline4;
- Transparency = 1
- });
- local inline5 = library:create("Frame", {
- Parent = inline4;
- BackgroundTransparency = 1;
- Size = dim2(1, 0, 1, 0);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- local tab_holder = library:create("Frame", {
- Parent = inline5;
- BackgroundTransparency = 1;
- Position = dim2(0, 17, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 28);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal;
- HorizontalFlex = Enum.UIFlexAlignment.Fill;
- Parent = tab_holder;
- Padding = dim(0, 4);
- SortOrder = Enum.SortOrder.LayoutOrder;
- VerticalFlex = Enum.UIFlexAlignment.Fill
- });
- local button = library:create("TextButton", {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "keybinds";
- Parent = tab_holder;
- TextStrokeTransparency = 0;
- BackgroundTransparency = 1;
- Size = dim2(0, 200, 0, 50);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- local accent = library:create("Frame", {
- AnchorPoint = vec2(0, 1);
- Parent = button;
- Position = dim2(0, 0, 1, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 4);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- }); library:apply_theme(accent, "accent", "BackgroundColor3")
- local split = library:create("Frame", {
- AnchorPoint = vec2(0, 1);
- Parent = accent;
- Position = dim2(0, 0, 1, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 2);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- }); library:apply_theme(split, "accent", "BackgroundColor3")
- library:create("UIGradient", {
- Color = rgbseq{rgbkey(0, rgb(167, 167, 167)), rgbkey(1, rgb(167, 167, 167))};
- Parent = split
- });
- local inline6 = library:create("Frame", {
- Parent = inline5;
- Size = dim2(1, -34, 0, 0);
- BackgroundTransparency = 1;
- Position = dim2(0, 17, 0, 31);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- local inline7 = library:create("Frame", {
- Parent = inline6;
- Size = dim2(1, -2, 1, -2);
- Position = dim2(0, 1, 0, 1);
- BackgroundTransparency = 1;
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(46, 46, 46)
- });
- local inline8 = library:create("Frame", {
- Parent = inline7;
- Size = dim2(1, -2, 1, -2);
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundTransparency = 1;
- BackgroundColor3 = rgb(21, 21, 21)
- }); library.keybind_list = inline8
- library:create("UIListLayout", {
- Parent = inline8;
- Padding = dim(0, 10);
- SortOrder = Enum.SortOrder.LayoutOrder
- });
- library:create("UIPadding", {
- PaddingTop = dim(0, 8);
- PaddingBottom = dim(0, 8);
- Parent = inline8;
- PaddingRight = dim(0, 2);
- PaddingLeft = dim(0, 8)
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = inline7
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = inline6
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 10);
- PaddingRight = dim(0, 34);
- Parent = inline5
- });
- library:create("UIPadding", {
- Parent = inline4
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = inline3
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = inline2
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = inline1
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 2);
- PaddingRight = dim(0, 2);
- Parent = cfg.keybind_list
- });
- --
- -- Playerlist
- items[ "outline" ] = library:create( "Frame" , {
- Parent = library[ "other" ];
- Name = "\0";
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0.1417543888092041, 0, 0.3601022958755493, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- }); cfg.mod_list = items[ "outline" ]
- library:draggify(items[ "outline" ])
- library:resizify(items[ "outline" ])
- items[ "outline" ].Position = dim2(0, items[ "main" ].AbsoluteSize.X + items[ "main" ].AbsolutePosition.X + 5, 0, items[ "main" ].AbsolutePosition.Y + 58);
- items[ "inline" ] = library:create( "Frame" , {
- Parent = items[ "outline" ];
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = "MODERATOR LIST";
- Parent = items[ "inline" ];
- TextStrokeTransparency = 0;
- Name = "\0";
- Size = dim2(1, 0, 0, 11);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Position = dim2(0, 15, 0, 15);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "scrolling" ] = library:create( "ScrollingFrame" , {
- ScrollBarImageColor3 = rgb(132, 135, 250);
- Active = true;
- AutomaticCanvasSize = Enum.AutomaticSize.Y;
- ScrollBarThickness = 2;
- Parent = items[ "inline" ];
- Name = "\0";
- Size = dim2(1, 0, 1, -23);
- BackgroundColor3 = rgb(255, 255, 255);
- BackgroundTransparency = 1;
- Position = dim2(0, 0, 0, 23);
- ScrollingEnabled = false;
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- CanvasSize = dim2(0, 0, 0, 0)
- });
- library:create( "UIPadding" , {
- Parent = items[ "scrolling" ];
- PaddingTop = dim(0, 18);
- PaddingRight = dim(0, 15);
- PaddingLeft = dim(0, 15)
- });
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = items[ "scrolling" ];
- BackgroundTransparency = 1;
- Name = "\0";
- Size = dim2(1, -31, 1, -10);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "playerlist_holder" ] = library:create( "Frame" , {
- Parent = items[ "object" ];
- BackgroundTransparency = 1;
- Name = "\0";
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, -23);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "ScrollingFrame" ] = library:create( "ScrollingFrame" , {
- ScrollBarImageColor3 = rgb(132, 135, 250);
- Active = true;
- AutomaticCanvasSize = Enum.AutomaticSize.Y;
- ScrollBarThickness = 2;
- Parent = items[ "playerlist_holder" ];
- Size = dim2(1, 0, 1, -20);
- BackgroundTransparency = 1;
- Position = dim2(0, 0, 0, 10);
- BackgroundColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- CanvasSize = dim2(0, 0, 0, 0)
- });
- library:create( "UIPadding" , {
- PaddingTop = dim(0, 10);
- PaddingBottom = dim(0, 10);
- Parent = items[ "ScrollingFrame" ];
- PaddingRight = dim(0, 10);
- PaddingLeft = dim(0, 10)
- });
- library:create( "UIListLayout" , {
- Parent = items[ "ScrollingFrame" ];
- Padding = dim(0, 10);
- SortOrder = Enum.SortOrder.LayoutOrder
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "playerlist_holder" ]
- });
- function cfg.add_mod(name)
- library:create( "TextLabel" , {
- TextWrapped = true;
- Name = name;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = name;
- Parent = items[ "ScrollingFrame" ];
- TextStrokeTransparency = 0;
- Size = dim2(1, 0, 0, 0);
- BorderSizePixel = 0;
- BackgroundTransparency = 1;
- Position = dim2(0, 20, 0, 0);
- AutomaticSize = Enum.AutomaticSize.XY;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- end
- function cfg.remove_mod(name)
- items[ "ScrollingFrame" ][name]:Destroy()
- end
- --
- return setmetatable(cfg, library)
- end
- function library:tab(properties)
- local cfg = {
- name = properties.name or "ecstasy";
- items = {};
- icon = properties.icon or "rbxassetid://139765537381996"
- }
- local items = cfg.items; do
- -- Tab buttons
- items[ "button" ] = library:create( "TextButton" , {
- Parent = self.items[ "tab_holder" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Position = dim2(0, -1, 0, 0);
- Text = "";
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 66);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(27, 27, 27)
- });
- items[ "logo" ] = library:create( "ImageLabel" , {
- ImageColor3 = rgb(69, 69, 71);
- BorderColor3 = rgb(0, 0, 0);
- Parent = items[ "button" ];
- AnchorPoint = vec2(0.5, 0.5);
- Image = cfg.icon;
- BackgroundTransparency = 1;
- Position = dim2(0.5, 0, 0.5, -10);
- Name = "\0";
- Size = dim2(0, 32, 0, 32);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- }); library:apply_theme(items[ "logo" ], "accent", "ImageColor3")
- items[ "text" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(69, 69, 71);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- TextStrokeTransparency = 0;
- Parent = items[ "button" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Position = dim2(0, 0, 0, 19);
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- }); library:apply_theme(items[ "text" ], "accent", "TextColor3")
- --
- -- Tab Directory
- items[ "tab" ] = library:create( "Frame" , {
- Parent = self.items[ "main" ];
- Name = "\0";
- Visible = false;
- BackgroundTransparency = 1;
- Position = dim2(0, 80, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -80, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIPadding" , {
- PaddingTop = dim(0, 14);
- PaddingBottom = dim(0, 14);
- Parent = items[ "tab" ];
- PaddingRight = dim(0, 14);
- PaddingLeft = dim(0, 14)
- });
- library:create( "UIListLayout" , {
- FillDirection = Enum.FillDirection.Horizontal;
- HorizontalFlex = Enum.UIFlexAlignment.Fill;
- Parent = items[ "tab" ];
- Padding = dim(0, 14);
- SortOrder = Enum.SortOrder.LayoutOrder;
- VerticalFlex = Enum.UIFlexAlignment.Fill
- });
- for _, side in {"left", "middle", "right"} do
- items[ side .. "_column" ] = library:create( "Frame" , {
- Parent = items[ "tab" ];
- BackgroundTransparency = 1;
- Name = "\0";
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- });
- end
- --
- end
- function cfg.open_tab()
- local selected_tab = self.selected_tab
- if selected_tab then
- selected_tab[ 1 ].ImageColor3 = rgb(69, 69, 71)
- selected_tab[ 2 ].TextColor3 = rgb(69, 69, 71)
- selected_tab[ 3 ].Visible = false
- end
- items[ "logo" ].ImageColor3 = themes.preset.accent
- items[ "text" ].TextColor3 = themes.preset.accent
- items[ "tab" ].Visible = true
- self.selected_tab = {
- items[ "logo" ];
- items[ "text" ];
- items[ "tab" ];
- }
- end
- items[ "button" ].MouseButton1Down:Connect(function()
- cfg.open_tab()
- end)
- if not self.selected_tab then
- cfg.open_tab(true)
- end
- return setmetatable(cfg, library)
- end
- function library:section(properties)
- local cfg = {
- name = properties.name or properties.Name or "section";
- side = properties.side or "left";
- items = {};
- };
- local items = cfg.items; do -- Instances
- items[ "outline" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = self.items[ cfg.side .. "_column" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- });
- items[ "inline" ] = library:create( "Frame" , {
- Parent = items[ "outline" ];
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- Parent = items[ "inline" ];
- TextStrokeTransparency = 0;
- Name = "\0";
- Size = dim2(1, 0, 0, 11);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Position = dim2(0, 15, 0, 15);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "scrolling_frame" ] = library:create( "ScrollingFrame" , {
- ScrollBarImageColor3 = rgb(119, 119, 239);
- Active = true;
- AutomaticCanvasSize = Enum.AutomaticSize.Y;
- ScrollBarThickness = 4;
- Parent = items[ "inline" ];
- Name = "\0";
- Size = dim2(1, 0, 1, -23);
- BackgroundTransparency = 1;
- Position = dim2(0, 0, 0, 23);
- BackgroundColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- CanvasSize = dim2(0, 0, 0, 0)
- });
- items[ "elements" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = items[ "scrolling_frame" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -31, 0, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIListLayout" , {
- Parent = items[ "elements" ];
- Padding = dim(0, 15);
- SortOrder = Enum.SortOrder.LayoutOrder
- });
- library:create( "UIPadding" , {
- Parent = items[ "scrolling_frame" ];
- PaddingTop = dim(0, 18);
- PaddingRight = dim(0, 15);
- PaddingLeft = dim(0, 15)
- });
- end;
- return setmetatable(cfg, library)
- end
- -- Elements
- function library:toggle(options)
- local cfg = {
- enabled = options.enabled or nil,
- name = options.name or "Toggle",
- info = options.info or "",
- flag = options.flag or library:next_flag(),
- default = options.default or false,
- folding = options.folding or false,
- callback = options.callback or function() end,
- items = {};
- }
- flags[cfg.flag] = cfg.default
- local items = cfg.items; do
- items[ "object" ] = library:create( "TextButton" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- BackgroundTransparency = 1;
- Name = "\0";
- Size = dim2(1, 0, 0, 22);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- TextStrokeTransparency = 0;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "info" ] = library:create( "TextLabel" , {
- TextWrapped = true;
- Parent = items[ "object" ];
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.info;
- Name = "\0";
- TextStrokeTransparency = 0;
- Size = dim2(1, 0, 0, 11);
- Position = dim2(0, 0, 0, 13);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "toggle_holder" ] = library:create( "Frame" , {
- AnchorPoint = vec2(1, 0);
- Parent = items[ "object" ];
- Name = "\0";
- Position = dim2(1, 0, 0, 5);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 34, 0, 20);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- });
- library:create( "UICorner" , {
- Parent = items[ "toggle_holder" ];
- CornerRadius = dim(0, 99)
- });
- items[ "circle" ] = library:create( "Frame" , {
- Parent = items[ "toggle_holder" ];
- Name = "\0";
- Position = dim2(0, 2, 0, 2);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 16, 0, 16);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(68, 68, 70)
- }); library:apply_theme(items[ "circle" ], "accent", "BackgroundColor3")
- library:create( "UICorner" , {
- Parent = items[ "circle" ];
- CornerRadius = dim(0, 99)
- });
- end;
- function cfg.set(bool)
- items[ "circle" ].BackgroundColor3 = bool and themes.preset.accent or rgb(68, 68, 70)
- items[ "circle" ].Position = bool and dim_offset(15, 2) or dim_offset(2, 2)
- cfg.callback(bool)
- flags[cfg.flag] = bool
- end
- items[ "object" ].MouseButton1Click:Connect(function()
- cfg.enabled = not cfg.enabled
- cfg.set(cfg.enabled)
- end)
- cfg.set(cfg.default)
- config_flags[cfg.flag] = cfg.set
- return setmetatable(cfg, library)
- end
- function library:slider(options)
- local cfg = {
- name = options.name or nil,
- suffix = options.suffix or "",
- flag = options.flag or library:next_flag(),
- callback = options.callback or function() end,
- -- value settings
- min = options.min or options.minimum or 0,
- max = options.max or options.maximum or 100,
- intervals = options.interval or options.decimal or 1,
- default = options.default or 10,
- value = options.default or 10,
- dragging = false,
- items = {}
- }
- flags[cfg.flag] = cfg.default
- local items = cfg.items; do
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Size = dim2(1, 0, 0, 28);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.Y;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- TextStrokeTransparency = 0;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "slider" ] = library:create( "TextButton" , {
- Parent = items[ "object" ];
- Text = "";
- AutoButtonColor = false;
- Name = "\0";
- Position = dim2(0, 0, 0, 22);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 6);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(33, 33, 33)
- });
- items[ "fill" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = items[ "slider" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0.5, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- }); library:apply_theme(items[ "fill" ], "accent", "BackgroundColor3")
- items[ "circle" ] = library:create( "Frame" , {
- AnchorPoint = vec2(0.5, 0.5);
- Parent = items[ "fill" ];
- Name = "\0";
- Position = dim2(1, 0, 0.5, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 12, 0, 12);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- }); library:apply_theme(items[ "circle" ], "accent", "BackgroundColor3")
- library:create( "UICorner" , {
- Parent = items[ "circle" ];
- CornerRadius = dim(0, 99)
- });
- items[ "value" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "300 metres";
- TextStrokeTransparency = 0;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Right;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- end
- function cfg.set(value)
- cfg.value = clamp(library:round(value, cfg.intervals), cfg.min, cfg.max)
- items[ "fill" ].Size = dim2((cfg.value - cfg.min) / (cfg.max - cfg.min), 0, 1, 0)
- items[ "value" ].Text = tostring(cfg.value) .. cfg.suffix
- flags[cfg.flag] = cfg.value
- cfg.callback(flags[cfg.flag])
- end
- items[ "slider" ].MouseButton1Down:Connect(function()
- cfg.dragging = true
- end)
- library:connection(uis.InputChanged, function(input)
- if cfg.dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local size_x = (input.Position.X - items[ "slider" ].AbsolutePosition.X) / items[ "slider" ].AbsoluteSize.X
- local value = ((cfg.max - cfg.min) * size_x) + cfg.min
- cfg.set(value)
- end
- end)
- library:connection(uis.InputEnded, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- cfg.dragging = false
- end
- end)
- cfg.set(cfg.default)
- config_flags[cfg.flag] = cfg.set
- return setmetatable(cfg, library)
- end
- function library:dropdown(options)
- local cfg = {
- name = options.name or "Dropdown";
- info = options.info or "";
- flag = options.flag or library:next_flag();
- options = options.items or {""};
- callback = options.callback or function() end;
- multi = options.multi or false;
- scrolling = options.scrolling or false;
- -- Ignore these
- open = false;
- option_instances = {};
- multi_items = {};
- ignore = options.ignore or false;
- items = {};
- }
- cfg.default = options.default or (cfg.multi and {cfg.items[1]}) or cfg.items[1] or "None"
- flags[cfg.flag] = cfg.default
- local items = cfg.items; do
- -- Element
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- BackgroundTransparency = 1;
- Name = "\0";
- Size = dim2(1, 0, 0, 25);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(237, 237, 237);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "info" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.info;
- Parent = items[ "object" ];
- Name = "\0";
- Size = dim2(1, 0, 0, 11);
- Position = dim2(0, 0, 0, 13);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- TextWrapped = true;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "dropdown_holder" ] = library:create( "TextButton" , {
- AnchorPoint = vec2(1, 0.5);
- Parent = items[ "object" ];
- Name = "\0";
- Text = "";
- AutoButtonColor = false;
- Position = dim2(1, 0, 0.5, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 85, 0, 18);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(18, 18, 20)
- });
- items[ "text_holder" ] = library:create( "TextButton" , {
- Parent = items[ "dropdown_holder" ];
- Name = "\0";
- Text = "";
- AutoButtonColor = false;
- BorderColor3 = rgb(0, 0, 0);
- Position = dim2(0, 1, 0, 1);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9);
- });
- library:create( "UICorner" , {
- Parent = items[ "dropdown_holder" ];
- CornerRadius = dim(0, 3)
- });
- library:create( "UICorner" , {
- Parent = items[ "text_holder" ];
- CornerRadius = dim(0, 3)
- });
- items[ "inner_text" ] = library:create( "TextLabel" , {
- TextWrapped = true;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "RMB";
- Parent = items[ "text_holder" ];
- TextStrokeTransparency = 0;
- Size = dim2(1, 0, 1, 0);
- Position = dim2(0, 4, 0, 0);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "arrow" ] = library:create( "ImageLabel" , {
- BorderColor3 = rgb(0, 0, 0);
- Parent = items[ "text_holder" ];
- AnchorPoint = vec2(1, 0.5);
- Image = "rbxassetid://116451868004607";
- BackgroundTransparency = 1;
- Position = dim2(1, -10, 0.5, 0);
- Name = "\0";
- Size = dim2(0, 7, 0, 5);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- --
- -- Holder
- items[ "holder" ] = library:create( "Frame" , {
- Parent = library[ "items" ];
- Size = dim2(0, 0, 0, 0);
- Position = dim2(0, 0, 0, 0);
- Visible = false;
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- library:create( "UICorner" , {
- Parent = items[ "holder" ];
- CornerRadius = dim(0, 3)
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "holder" ]
- });
- library:create( "UIListLayout" , {
- Parent = items[ "holder" ];
- Padding = dim(0, 10);
- SortOrder = Enum.SortOrder.LayoutOrder;
- HorizontalFlex = Enum.UIFlexAlignment.Fill
- });
- library:create( "UIPadding" , {
- PaddingTop = dim(0, 10);
- PaddingBottom = dim(0, 10);
- Parent = items[ "holder" ];
- PaddingRight = dim(0, 10);
- PaddingLeft = dim(0, 10)
- });
- --
- end
- function cfg.render_option(text)
- local option = library:create( "TextButton" , {
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = text;
- Parent = items[ "holder" ];
- TextStrokeTransparency = 0;
- Position = dim2(0, 4, 0, 0);
- BorderSizePixel = 0;
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- FontFace = fonts.main;
- AutomaticSize = Enum.AutomaticSize.XY;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- }); library:apply_theme(option, "accent", "TextColor3");
- return option
- end
- function cfg.set_visible(bool)
- items[ "holder" ].Visible = bool
- items[ "holder" ].Position = dim2(0, items[ "dropdown_holder" ].AbsolutePosition.X, 0, items[ "dropdown_holder" ].AbsolutePosition.Y + 85)
- items[ "arrow" ].Rotation = bool and 180 or 0
- end
- function cfg.set(value)
- local selected = {}
- local isTable = type(value) == "table"
- for _, option in next, cfg.option_instances do
- if option.Text == value or (isTable and find(value, option.Text)) then
- insert(selected, option.Text)
- cfg.multi_items = selected
- option.TextColor3 = themes.preset.accent
- else
- option.TextColor3 = themes.preset.text
- end
- end
- items[ "inner_text" ].Text = if isTable then concat(selected, ", ") else selected[1] or ""
- flags[cfg.flag] = if isTable then selected else selected[1]
- cfg.callback(flags[cfg.flag])
- end
- function cfg.refresh_options(list)
- for _, option in cfg.option_instances do
- option:Destroy()
- end
- cfg.option_instances = {}
- for _, option in list do
- local button = cfg.render_option(option)
- insert(cfg.option_instances, button)
- button.MouseButton1Down:Connect(function()
- if cfg.multi then
- local selected_index = find(cfg.multi_items, button.Text)
- if selected_index then
- remove(cfg.multi_items, selected_index)
- else
- insert(cfg.multi_items, button.Text)
- end
- cfg.set(cfg.multi_items)
- else
- cfg.set_visible(false)
- cfg.open = false
- cfg.set(button.Text)
- end
- end)
- end
- end
- items[ "text_holder" ].MouseButton1Click:Connect(function()
- cfg.open = not cfg.open
- cfg.set_visible(cfg.open)
- end)
- library:connection(uis.InputBegan, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not (library:mouse_in_frame(items[ "text_holder" ]) or library:mouse_in_frame(items[ "holder" ])) then
- cfg.open = false
- cfg.set_visible(false)
- end
- end
- end)
- flags[cfg.flag] = {}
- config_flags[cfg.flag] = cfg.set
- cfg.refresh_options(cfg.options)
- cfg.set(cfg.default)
- return setmetatable(cfg, library)
- end
- function library:colorpicker(options)
- local cfg = {
- name = options.name or "Colorpicker",
- info = options.info or "Info";
- flag = options.flag or library:next_flag(),
- color = options.color or color(1, 1, 1), -- Default to white color if not provided
- alpha = options.alpha and 1 - options.alpha or 0,
- open = false,
- callback = options.callback or function() end,
- items = {};
- }
- local dragging_sat = false
- local dragging_hue = false
- local dragging_alpha = false
- local h, s, v = cfg.color:ToHSV()
- local a = cfg.alpha
- flags[cfg.flag] = {Color = cfg.color, Transparency = cfg.alpha}
- local items = cfg.items; do
- -- Component
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Size = dim2(1, 0, 0, 22);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.Y;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- TextStrokeTransparency = 0;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "info" ] = library:create( "TextLabel" , {
- TextWrapped = true;
- Parent = items[ "object" ];
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.info;
- Name = "\0";
- TextStrokeTransparency = 0;
- Size = dim2(1, 0, 0, 11);
- Position = dim2(0, 0, 0, 13);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "colorpicker" ] = library:create( "TextButton" , {
- AnchorPoint = vec2(1, 0);
- Parent = items[ "object" ];
- Text = "";
- AutoButtonColor = false;
- Name = "\0";
- Position = dim2(1, 0, 0, 5);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 16, 0, 16);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(132, 135, 250)
- });
- library:create( "UICorner" , {
- Parent = items[ "colorpicker" ];
- CornerRadius = dim(0, 3)
- });
- --
- -- Colorpicker
- items[ "colorpicker_holder" ] = library:create( "Frame" , {
- Parent = library[ "items" ];
- Size = dim2(0, 180, 0, 180);
- Name = "\0";
- Visible = false;
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 100;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- library:create( "UICorner" , {
- Parent = items[ "colorpicker_holder" ];
- CornerRadius = dim(0, 4)
- });
- items[ "colorpicker_inline" ] = library:create( "Frame" , {
- Parent = items[ "colorpicker_holder" ];
- Size = dim2(1, -2, 1, -2);
- Name = "\0";
- ClipsDescendants = true;
- BorderColor3 = rgb(0, 0, 0);
- Position = dim2(0, 1, 0, 1);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(32, 32, 32)
- });
- library:create( "UICorner" , {
- Parent = items[ "colorpicker_inline" ];
- CornerRadius = dim(0, 4)
- });
- items[ "colorpicker_background" ] = library:create( "Frame" , {
- Parent = items[ "colorpicker_inline" ];
- Size = dim2(1, -2, 1, -2);
- Name = "\0";
- ClipsDescendants = true;
- BorderColor3 = rgb(0, 0, 0);
- Position = dim2(0, 1, 0, 1);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(8, 8, 8)
- });
- library:create( "UICorner" , {
- Parent = items[ "colorpicker_background" ];
- CornerRadius = dim(0, 4)
- });
- library:create( "UIPadding" , {
- PaddingTop = dim(0, 5);
- PaddingBottom = dim(0, 5);
- Parent = items[ "colorpicker_background" ];
- PaddingRight = dim(0, 5);
- PaddingLeft = dim(0, 5)
- });
- items[ "saturation_outline" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = items[ "colorpicker_background" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -12, 1, -12);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- items[ "color_saturation" ] = library:create( "TextButton" , {
- Parent = items[ "saturation_outline" ];
- AutoButtonColor = false;
- Text = "";
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 39, 39)
- });
- items[ "sat" ] = library:create( "Frame" , {
- Parent = items[ "color_saturation" ];
- Name = "\0";
- Size = dim2(1, 0, 1, 0);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 2;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIGradient" , {
- Rotation = 270;
- Transparency = numseq{numkey(0, 0), numkey(1, 1)};
- Parent = items[ "sat" ];
- Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(0, 0, 0))}
- });
- items[ "satval_picker" ] = library:create( "Frame" , {
- Parent = items[ "color_saturation" ];
- Size = dim2(0, 3, 0, 3);
- Name = "\0";
- Position = dim2(0, 1, 0.5, 1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 4;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- library:create( "Frame" , {
- Parent = items[ "satval_picker" ];
- Size = dim2(1, -2, 1, -2);
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 2;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "val" ] = library:create( "Frame" , {
- Name = "\0";
- Parent = items[ "color_saturation" ];
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIGradient" , {
- Parent = items[ "val" ];
- Transparency = numseq{numkey(0, 0), numkey(1, 1)}
- });
- items[ "hue_slider" ] = library:create( "TextButton" , {
- Parent = items[ "colorpicker_background" ];
- Text = "";
- AutoButtonColor = false;
- Name = "\0";
- Position = dim2(1, -10, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 10, 1, -12);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- items[ "hue_components" ] = library:create( "Frame" , {
- Parent = items[ "hue_slider" ];
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIGradient" , {
- Rotation = 270;
- Parent = items[ "hue_components" ];
- Color = rgbseq{rgbkey(0, rgb(255, 0, 0)), rgbkey(0.17, rgb(255, 255, 0)), rgbkey(0.33, rgb(0, 255, 0)), rgbkey(0.5, rgb(0, 255, 255)), rgbkey(0.67, rgb(0, 0, 255)), rgbkey(0.83, rgb(255, 0, 255)), rgbkey(1, rgb(255, 0, 0))}
- });
- items[ "hue_picker" ] = library:create( "Frame" , {
- Parent = items[ "hue_components" ];
- Size = dim2(1, 2, 0, 3);
- Name = "\0";
- Position = dim2(0, -1, 0, -1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 4;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- library:create( "Frame" , {
- Parent = items[ "hue_picker" ];
- Size = dim2(1, -2, 1, -2);
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 2;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "alpha_slider" ] = library:create( "TextButton" , {
- Parent = items[ "colorpicker_background" ];
- Text = "";
- AutoButtonColor = false;
- Name = "\0";
- Position = dim2(0, 0, 1, -10);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -12, 0, 10);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- items[ "alpha_components" ] = library:create( "Frame" , {
- Parent = items[ "alpha_slider" ];
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, -2, 1, -2);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIGradient" , {
- Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(255, 255, 255))};
- Parent = items[ "alpha_components" ]
- });
- items[ "alpha_picker" ] = library:create( "Frame" , {
- Parent = items[ "alpha_components" ];
- Size = dim2(0, 3, 1, 2);
- Name = "\0";
- Position = dim2(0, -1, 0, -1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 4;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(0, 0, 0)
- });
- library:create( "Frame" , {
- Parent = items[ "alpha_picker" ];
- Size = dim2(1, -2, 1, -2);
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- ZIndex = 2;
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- --
- end;
- function cfg.set_visible(bool)
- items[ "colorpicker_holder" ].Visible = bool
- items[ "colorpicker_holder" ].Position = dim_offset(items[ "colorpicker" ].AbsolutePosition.X, items[ "colorpicker" ].AbsolutePosition.Y + items[ "colorpicker" ].AbsoluteSize.Y + 65)
- end
- function cfg.set(color, alpha)
- if color then
- h, s, v = color:ToHSV()
- end
- if alpha then
- a = alpha
- end
- local Color = Color3.fromHSV(h, s, v)
- items[ "hue_picker" ].Position = dim2(0, -1, 1 - h, -1)
- items[ "alpha_picker" ].Position = dim2(1 - a, -1, 0, -1)
- items[ "satval_picker" ].Position = dim2(s, -1, 1 - v, -1)
- items[ "colorpicker" ].BackgroundColor3 = Color
- items[ "color_saturation" ].BackgroundColor3 = Color3.fromHSV(h, 1, 1)
- flags[cfg.flag] = {
- Color = Color;
- Transparency = a
- }
- cfg.callback(Color, a)
- end
- function cfg.update_color()
- local mouse = uis:GetMouseLocation()
- local offset = vec2(mouse.X, mouse.Y - gui_offset)
- if dragging_sat then
- s = math.clamp((offset - items["color_saturation"].AbsolutePosition).X / items["color_saturation"].AbsoluteSize.X, 0, 1)
- v = 1 - math.clamp((offset - items["color_saturation"].AbsolutePosition).Y / items["color_saturation"].AbsoluteSize.Y, 0, 1)
- elseif dragging_hue then
- h = 1 - math.clamp((offset - items[ "hue_slider" ].AbsolutePosition).Y / items[ "hue_slider" ].AbsoluteSize.Y, 0, 1)
- elseif dragging_alpha then
- a = 1 - math.clamp((offset - items[ "alpha_slider" ].AbsolutePosition).X / items[ "alpha_slider" ].AbsoluteSize.X, 0, 1)
- end
- cfg.set(nil, nil)
- end
- items[ "colorpicker" ].MouseButton1Click:Connect(function()
- cfg.open = not cfg.open
- cfg.set_visible(cfg.open)
- end)
- uis.InputChanged:Connect(function(input)
- if (dragging_sat or dragging_hue or dragging_alpha) and input.UserInputType == Enum.UserInputType.MouseMovement then
- cfg.update_color()
- end
- end)
- library:connection(uis.InputEnded, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging_sat = false
- dragging_hue = false
- dragging_alpha = false
- if not (library:mouse_in_frame(items[ "colorpicker" ]) or library:mouse_in_frame(items[ "colorpicker_holder" ])) then
- cfg.open = false
- cfg.set_visible(false)
- end
- end
- end)
- library:connection(uis.InputBegan, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not (library:mouse_in_frame(items[ "colorpicker" ]) or library:mouse_in_frame(items[ "colorpicker_holder" ])) then
- cfg.open = false
- cfg.set_visible(false)
- end
- end
- end)
- items[ "alpha_slider" ].MouseButton1Down:Connect(function()
- dragging_alpha = true
- end)
- items[ "hue_slider" ].MouseButton1Down:Connect(function()
- dragging_hue = true
- end)
- items[ "color_saturation" ].MouseButton1Down:Connect(function()
- dragging_sat = true
- end)
- cfg.set(cfg.color, cfg.alpha)
- config_flags[cfg.flag] = cfg.set
- return setmetatable(cfg, library)
- end
- function library:textbox(options)
- local cfg = {
- name = options.name or "TextBox",
- placeholder = options.placeholder or options.placeholdertext or options.holder or options.holdertext or "type here...",
- default = options.default or "",
- flag = options.flag or library:next_flag(),
- callback = options.callback or function() end,
- visible = options.visible or true,
- items = {};
- }
- flags[cfg.flag] = cfg.default
- local items = cfg.items; do
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Size = dim2(1, 0, 0, 28);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.Y;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "holder" ] = library:create( "Frame" , {
- AnchorPoint = vec2(1, 0.5);
- Parent = items[ "object" ];
- Name = "\0";
- Position = dim2(1, 0, 0.5, 10);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 0, 22);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- library:create( "UICorner" , {
- Parent = items[ "holder" ];
- CornerRadius = dim(0, 3)
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "holder" ]
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- Parent = items[ "object" ];
- TextStrokeTransparency = 0;
- Name = "\0";
- Size = dim2(1, 0, 0, 0);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.Y;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "input" ] = library:create( "TextBox" , {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "255";
- Parent = items[ "holder" ];
- Name = "\0";
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundTransparency = 1;
- PlaceholderColor3 = rgb(255, 255, 255);
- CursorPosition = -1;
- TextWrapped = true;
- ClearTextOnFocus = false;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- end
- function cfg.set(text)
- flags[cfg.flag] = text
- items[ "input" ].Text = text
- cfg.callback(text)
- end
- items[ "input" ]:GetPropertyChangedSignal("Text"):Connect(function()
- cfg.set(items[ "input" ].Text)
- end)
- if cfg.default then
- cfg.set(cfg.default)
- end
- config_flags[cfg.flag] = cfg.set
- return setmetatable(cfg, library)
- end
- function library:keybind(options)
- local cfg = {
- flag = options.flag or library:next_flag(),
- callback = options.callback or function() end,
- name = options.name or "Keybind";
- info = options.info or "";
- ignore_key = options.ignore or false,
- key = options.key or nil,
- mode = options.mode or "Toggle",
- active = options.default or false,
- open = false,
- binding = nil,
- hold_instances = {},
- items = {};
- }
- flags[cfg.flag] = {
- mode = cfg.mode,
- key = cfg.key,
- active = cfg.active
- }
- local items = cfg.items; do
- -- Component
- items[ "object" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- BackgroundTransparency = 1;
- Name = "\0";
- Size = dim2(1, 0, 0, 25);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(237, 237, 237);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- Parent = items[ "object" ];
- Name = "\0";
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- Size = dim2(1, 0, 0, 11);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "info" ] = library:create( "TextLabel" , {
- FontFace = fonts.main;
- TextColor3 = rgb(68, 68, 70);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.info;
- Parent = items[ "object" ];
- Name = "\0";
- Size = dim2(1, 0, 0, 11);
- Position = dim2(0, 0, 0, 13);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- TextWrapped = true;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "filler" ] = library:create( "Frame" , {
- AnchorPoint = vec2(1, 0.5);
- Parent = items[ "object" ];
- Name = "\0";
- Position = dim2(1, 0, 0.5, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 46, 0, 19);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- items[ "keybinds" ] = library:create( "TextButton" , {
- AnchorPoint = vec2(1, 0.5);
- Text = "";
- Parent = items[ "object" ];
- Name = "\0";
- Position = dim2(1, 0, 0.5, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 46, 0, 19);
- BorderSizePixel = 0;
- AutoButtonColor = false;
- BackgroundTransparency = 1;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- library:create( "UICorner" , {
- Parent = items[ "filler" ];
- CornerRadius = dim(0, 3)
- });
- items[ "name" ] = library:create( "TextLabel" , {
- TextWrapped = true;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "RMB";
- TextStrokeTransparency = 0;
- Parent = items[ "keybinds" ];
- Name = "\0";
- BackgroundTransparency = 1;
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "filler" ]
- });
- --
- -- Mode Holder
- items[ "element" ] = library:create( "Frame" , {
- BorderColor3 = rgb(0, 0, 0);
- AnchorPoint = vec2(1, 0.5);
- Parent = library[ "items" ];
- Name = "\0";
- Visible = false;
- Position = dim2(1, 0, 0.5, 0);
- Size = dim2(0, 0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- library:create( "UICorner" , {
- Parent = items[ "element" ];
- CornerRadius = dim(0, 3)
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "element" ]
- });
- library:create( "UIListLayout" , {
- Parent = items[ "element" ];
- Padding = dim(0, 10);
- SortOrder = Enum.SortOrder.LayoutOrder;
- HorizontalFlex = Enum.UIFlexAlignment.Fill
- });
- library:create( "UIPadding" , {
- PaddingTop = dim(0, 10);
- PaddingBottom = dim(0, 10);
- Parent = items[ "element" ];
- PaddingRight = dim(0, 10);
- PaddingLeft = dim(0, 10)
- });
- local options = {"Hold", "Toggle", "Always"}
- for _, option in options do
- local name = library:create( "TextButton" , {
- TextWrapped = true;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = option;
- Parent = items[ "element" ];
- TextStrokeTransparency = 0;
- Position = dim2(0, 4, 0, 0);
- BorderSizePixel = 0;
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- FontFace = fonts.main;
- AutomaticSize = Enum.AutomaticSize.XY;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- }); cfg.hold_instances[option] = name
- library:apply_theme(name, "accent", "TextColor3")
- name.MouseButton1Click:Connect(function()
- cfg.set(option)
- cfg.set_visible(false)
- cfg.open = false
- end)
- end
- --
- -- Keybind list text
- if not cfg.ignore_key then
- items[ "keybind_list_text" ] = library:create("TextLabel", {
- FontFace = fonts.main;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = "[ M ] triggerbot: always";
- Parent = library.keybind_list;
- AutomaticSize = Enum.AutomaticSize.XY;
- Position = dim2(0, 18, 0, -3);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- ZIndex = 2;
- TextStrokeTransparency = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- end
- --
- end
- function cfg.modify_mode_color(path) -- ts so frikin tuff 💀
- for _, v in cfg.hold_instances do
- v.TextColor3 = themes.preset.text
- end
- cfg.hold_instances[path].TextColor3 = themes.preset.accent
- end
- function cfg.set_mode(mode)
- cfg.mode = mode
- if mode == "Always" then
- cfg.set(true)
- elseif mode == "Hold" then
- cfg.set(false)
- end
- flags[cfg.flag]["mode"] = mode
- cfg.modify_mode_color(mode)
- end
- function cfg.set(input)
- if type(input) == "boolean" then
- cfg.active = input
- if cfg.mode == "Always" then
- cfg.active = true
- end
- elseif tostring(input):find("Enum") then
- input = input.Name == "Escape" and "NONE" or input
- cfg.key = input or "NONE"
- elseif find({"Toggle", "Hold", "Always"}, input) then
- if input == "Always" then
- cfg.active = true
- end
- cfg.mode = input
- cfg.set_mode(cfg.mode)
- elseif type(input) == "table" then
- input.key = type(input.key) == "string" and input.key ~= "NONE" and library:convert_enum(input.key) or input.key
- input.key = input.key == Enum.KeyCode.Escape and "NONE" or input.key
- cfg.key = input.key or "NONE"
- cfg.mode = input.mode or "Toggle"
- if input.active then
- cfg.active = input.active
- end
- cfg.set_mode(cfg.mode)
- end
- cfg.callback(cfg.active)
- local text = tostring(cfg.key) ~= "Enums" and (keys[cfg.key] or tostring(cfg.key):gsub("Enum.", "")) or nil
- local __text = text and (tostring(text):gsub("KeyCode.", ""):gsub("UserInputType.", ""))
- items[ "name" ].Text = __text
- flags[cfg.flag] = {
- mode = cfg.mode,
- key = cfg.key,
- active = cfg.active
- }
- if items[ "keybind_list_text" ] then
- items[ "keybind_list_text" ].Text = "[ ".. __text .." ] ".. cfg.name .." : ".. string.lower(cfg.mode) .."";
- items[ "keybind_list_text" ].Visible = cfg.active
- end
- end
- function cfg.set_visible(bool)
- items[ "element" ].Visible = bool
- items[ "element" ].Position = dim_offset(items[ "keybinds" ].AbsolutePosition.X + items[ "element" ].AbsoluteSize.X, items[ "keybinds" ].AbsolutePosition.Y + items[ "keybinds" ].AbsoluteSize.Y + 95)
- end
- items[ "keybinds" ].MouseButton1Down:Connect(function()
- task.wait()
- items[ "name" ].Text = "..."
- cfg.binding = library:connection(uis.InputBegan, function(keycode, game_event)
- cfg.set(keycode.KeyCode ~= Enum.KeyCode.Unknown and keycode.KeyCode or keycode.UserInputType)
- cfg.binding:Disconnect()
- cfg.binding = nil
- end)
- end)
- items[ "keybinds" ].MouseButton2Down:Connect(function()
- cfg.open = not cfg.open
- cfg.set_visible(cfg.open)
- end)
- library:connection(uis.InputBegan, function(input, game_event)
- if not game_event then
- local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
- if selected_key == cfg.key then
- if cfg.mode == "Toggle" then
- cfg.active = not cfg.active
- cfg.set(cfg.active)
- elseif cfg.mode == "Hold" then
- cfg.set(true)
- end
- end
- end
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not (library:mouse_in_frame(items[ "keybinds" ]) or library:mouse_in_frame(items[ "element" ])) then
- cfg.open = false
- cfg.set_visible(false)
- end
- end
- end)
- library:connection(uis.InputEnded, function(input, game_event)
- if game_event then
- return
- end
- local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
- if selected_key == cfg.key then
- if cfg.mode == "Hold" then
- cfg.set(false)
- end
- end
- end)
- cfg.set({mode = cfg.mode, active = cfg.active, key = cfg.key})
- config_flags[cfg.flag] = cfg.set
- return setmetatable(cfg, library)
- end
- function library:button(options)
- local cfg = {
- name = options.name or "TextBox",
- callback = options.callback or function() end,
- items = {};
- }
- local items = cfg.items; do
- items[ "object" ] = library:create( "TextButton" , {
- FontFace = fonts.main;
- TextColor3 = rgb(0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- Text = "";
- Parent = self.items[ "elements" ];
- BackgroundTransparency = 1;
- Name = "\0";
- Size = dim2(1, 0, 0, 22);
- BorderSizePixel = 0;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- items[ "button" ] = library:create( "Frame" , {
- AnchorPoint = vec2(1, 0.5);
- Parent = items[ "object" ];
- Name = "\0";
- Position = dim2(1, 0, 0.5, 0);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(1, 0, 1, 0);
- BorderSizePixel = 0;
- BackgroundColor3 = rgb(7, 7, 9)
- });
- library:create( "UICorner" , {
- Parent = items[ "button" ];
- CornerRadius = dim(0, 3)
- });
- items[ "title" ] = library:create( "TextLabel" , {
- TextWrapped = true;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = cfg.name;
- Parent = items[ "button" ];
- TextStrokeTransparency = 0;
- Name = "\0";
- Size = dim2(1, 0, 1, 0);
- BackgroundTransparency = 1;
- Position = dim2(0, 4, 0, 0);
- BorderSizePixel = 0;
- FontFace = fonts.main;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create( "UIStroke" , {
- Color = rgb(18, 18, 20);
- Parent = items[ "button" ]
- });
- end
- items[ "object" ].MouseButton1Click:Connect(function()
- cfg.callback()
- end)
- return setmetatable(cfg, library)
- end
- --
- --
- --
- -- Notification Library
- local notifications = library.notifications
- function notifications:refresh_notifs()
- local yOffset = 50
- for i, v in ipairs(notifications.notifs) do
- local Position = vec2(20, yOffset)
- tween_service:Create(v, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = dim_offset(Position.X, Position.Y)}):Play()
- yOffset = yOffset + v.AbsoluteSize.Y + 10
- end
- end
- function notifications:fade(path, is_fading)
- local fading = is_fading and 1 or 0
- tween_service:Create(path, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = fading}):Play()
- for _, instance in path:GetDescendants() do
- if instance:IsA("UIStroke") then
- tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Transparency = fading}):Play()
- elseif instance:IsA("TextLabel") then
- tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {TextTransparency = fading}):Play()
- elseif instance:IsA("Frame") then
- tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = fading}):Play()
- end
- end
- end
- function notifications:create_notification(options)
- local cfg = {
- name = options.name or "💊 ECSTASY",
- outline;
- }
- -- Instances
- local outline = library:create("Frame", {
- Parent = library[ "items" ];
- Size = dim2(0, 0, 0, 0);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(46, 46, 46)
- });
- local inline = library:create("Frame", {
- Parent = outline;
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- BorderSizePixel = 0;
- AutomaticSize = Enum.AutomaticSize.XY;
- BackgroundColor3 = rgb(21, 21, 21)
- });
- local uigradient = library:create("UIGradient", {
- Color = rgbseq{rgbkey(0, rgb(255, 0, 0)), rgbkey(0.17, rgb(255, 255, 0)), rgbkey(0.33, rgb(0, 255, 0)), rgbkey(0.5, rgb(0, 255, 255)), rgbkey(0.67, rgb(0, 0, 255)), rgbkey(0.83, rgb(255, 0, 255)), rgbkey(1, rgb(255, 0, 0))};
- Transparency = numseq{numkey(0, -1), numkey(1, -1)};
- Parent = menu_title
- });
- library:create("UIPadding", {
- PaddingTop = dim(0, 7);
- PaddingBottom = dim(0, 6);
- Parent = inline;
- PaddingRight = dim(0, 8);
- PaddingLeft = dim(0, 4)
- });
- local misc_text = library:create("TextLabel", {
- FontFace = fonts.main;
- Parent = inline;
- LineHeight = 1.75;
- TextColor3 = rgb(255, 255, 255);
- BorderColor3 = rgb(0, 0, 0);
- Text = string.format(" 🔴 PARADOX | %s", cfg.name);
- AutomaticSize = Enum.AutomaticSize.XY;
- Size = dim2(1, -4, 1, 0);
- Position = dim2(0, 4, 0, -2);
- BackgroundTransparency = 1;
- TextXAlignment = Enum.TextXAlignment.Left;
- BorderSizePixel = 0;
- ZIndex = 2;
- TextSize = 9;
- BackgroundColor3 = rgb(255, 255, 255)
- });
- library:create("UIPadding", {
- PaddingBottom = dim(0, 1);
- PaddingRight = dim(0, 1);
- Parent = outline
- });
- local line = library:create( "Frame" , {
- Parent = outline;
- Name = "\0";
- Position = dim2(0, 1, 1, -1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 0, 0, 1);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- });
- local accent = library:create( "Frame" , {
- Parent = outline;
- Name = "\0";
- Position = dim2(0, 1, 0, 1);
- BorderColor3 = rgb(0, 0, 0);
- Size = dim2(0, 1, 1, -1);
- BorderSizePixel = 0;
- BackgroundColor3 = themes.preset.accent
- });
- --
- local index = #notifications.notifs + 1
- notifications.notifs[index] = outline
- notifications:refresh_notifs()
- tween_service:Create(outline, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {AnchorPoint = vec2(0, 0)}):Play()
- notifications:fade(outline, false)
- task.spawn(function()
- tween_service:Create(line, TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = dim2(1, -1, 0, 1)}):Play()
- task.wait(5)
- notifications.notifs[index] = nil
- notifications:fade(outline, true)
- task.wait(1)
- outline:Destroy()
- notifications:refresh_notifs()
- end)
- end
- -- end of ui library
Add Comment
Please, Sign In to add comment