Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local CoreGui = game:GetService("CoreGui")
- local isMobile = UserInputService.TouchEnabled
- local uiWidth = isMobile and 500 or 700
- local uiHeight = isMobile and 320 or 450
- local sideWidth = isMobile and 150 or 200
- local Theme = {
- MainBg = Color3.fromRGB(12, 12, 12),
- SidebarBg = Color3.fromRGB(16, 16, 16),
- SectionBg = Color3.fromRGB(22, 22, 22),
- ItemBg = Color3.fromRGB(30, 30, 30),
- Accent = Color3.fromRGB(170, 130, 255),
- Text = Color3.fromRGB(245, 245, 245),
- SubText = Color3.fromRGB(140, 140, 140),
- DarkText = Color3.fromRGB(20, 20, 20)
- }
- local function CreateTween(instance, info, properties)
- local tween = TweenService:Create(instance, TweenInfo.new(unpack(info)), properties)
- tween:Play()
- return tween
- end
- local function MakeDraggable(topbar, object)
- local dragging, dragInput, dragStart, startPos
- topbar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = object.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- topbar.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- local delta = input.Position - dragStart
- CreateTween(object, {0.08, Enum.EasingStyle.Sine, Enum.EasingDirection.Out}, {
- Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- })
- end
- end)
- end
- local Library = {}
- function Library:Create(config)
- config = config or {}
- local uiConfig = config.UI or {}
- local sysConfig = config.Config or {}
- local screen = Instance.new("ScreenGui")
- screen.Name = "Rosava_Ui_Library"
- screen.ResetOnSpawn = false
- screen.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- local success = pcall(function() screen.Parent = gethui() end)
- if not success then screen.Parent = CoreGui end
- local mainFrame = Instance.new("Frame", screen)
- mainFrame.Size = UDim2.new(0, uiWidth, 0, uiHeight)
- mainFrame.Position = UDim2.new(0.5, -uiWidth/2, 0.5, -uiHeight/2)
- mainFrame.BackgroundColor3 = Theme.MainBg
- mainFrame.BorderSizePixel = 0
- mainFrame.ClipsDescendants = true
- Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 8)
- local dragArea = Instance.new("Frame", mainFrame)
- dragArea.Size = UDim2.new(1, 0, 0, 40)
- dragArea.BackgroundTransparency = 1
- dragArea.ZIndex = 100
- MakeDraggable(dragArea, mainFrame)
- local closeBtn = Instance.new("TextButton", dragArea)
- closeBtn.Size = UDim2.new(0, 30, 0, 30)
- closeBtn.Position = UDim2.new(1, -35, 0, 5)
- closeBtn.BackgroundTransparency = 1
- closeBtn.Text = "X"
- closeBtn.TextColor3 = Theme.SubText
- closeBtn.Font = Enum.Font.GothamBold
- closeBtn.TextSize = 14
- closeBtn.MouseButton1Click:Connect(function()
- CreateTween(mainFrame, {0.3, Enum.EasingStyle.Back, Enum.EasingDirection.In}, {Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0)})
- task.wait(0.3)
- screen:Destroy()
- end)
- local minBtn = Instance.new("TextButton", dragArea)
- minBtn.Size = UDim2.new(0, 30, 0, 30)
- minBtn.Position = UDim2.new(1, -70, 0, 5)
- minBtn.BackgroundTransparency = 1
- minBtn.Text = "-"
- minBtn.TextColor3 = Theme.SubText
- minBtn.Font = Enum.Font.GothamBold
- minBtn.TextSize = 20
- local minimized = false
- minBtn.MouseButton1Click:Connect(function()
- minimized = not minimized
- CreateTween(mainFrame, {0.4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out}, {Size = minimized and UDim2.new(0, uiWidth, 0, 40) or UDim2.new(0, uiWidth, 0, uiHeight)})
- end)
- local sidebar = Instance.new("Frame", mainFrame)
- sidebar.Size = UDim2.new(0, sideWidth, 1, 0)
- sidebar.BackgroundColor3 = Theme.SidebarBg
- sidebar.BorderSizePixel = 0
- local header = Instance.new("Frame", sidebar)
- header.Size = UDim2.new(1, 0, 0, 60)
- header.BackgroundTransparency = 1
- local logo = Instance.new("ImageLabel", header)
- logo.Size = UDim2.new(0, 24, 0, 24)
- logo.Position = UDim2.new(0, 15, 0.5, -12)
- logo.BackgroundTransparency = 1
- logo.Image = uiConfig.Icon or "rbxassetid://0"
- local titleLabel = Instance.new("TextLabel", header)
- titleLabel.Size = UDim2.new(1, -55, 0, 20)
- titleLabel.Position = UDim2.new(0, 45, 0, 12)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Text = uiConfig.Title or "Library"
- titleLabel.TextColor3 = Theme.Text
- titleLabel.Font = Enum.Font.GothamBold
- titleLabel.TextSize = 13
- titleLabel.TextXAlignment = Enum.TextXAlignment.Left
- local subTitleLabel = Instance.new("TextLabel", header)
- subTitleLabel.Size = UDim2.new(1, -55, 0, 15)
- subTitleLabel.Position = UDim2.new(0, 45, 0, 32)
- subTitleLabel.BackgroundTransparency = 1
- subTitleLabel.Text = uiConfig.SubTitle or "Version"
- subTitleLabel.TextColor3 = Theme.SubText
- subTitleLabel.Font = Enum.Font.Gotham
- subTitleLabel.TextSize = 11
- subTitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- local tabContainer = Instance.new("ScrollingFrame", sidebar)
- tabContainer.Size = UDim2.new(1, 0, 1, -130)
- tabContainer.Position = UDim2.new(0, 0, 0, 60)
- tabContainer.BackgroundTransparency = 1
- tabContainer.ScrollBarThickness = 0
- tabContainer.AutomaticCanvasSize = Enum.AutomaticSize.Y
- tabContainer.CanvasSize = UDim2.new(0, 0, 0, 0)
- local tabLayout = Instance.new("UIListLayout", tabContainer)
- tabLayout.Padding = UDim.new(0, 2)
- tabLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- local profileFrame = Instance.new("Frame", sidebar)
- profileFrame.Size = UDim2.new(1, 0, 0, 70)
- profileFrame.Position = UDim2.new(0, 0, 1, -70)
- profileFrame.BackgroundColor3 = Theme.MainBg
- profileFrame.BorderSizePixel = 0
- local avatar = Instance.new("ImageLabel", profileFrame)
- avatar.Size = UDim2.new(0, 36, 0, 36)
- avatar.Position = UDim2.new(0, 15, 0.5, -18)
- avatar.BackgroundColor3 = Theme.ItemBg
- Instance.new("UICorner", avatar).CornerRadius = UDim.new(1, 0)
- pcall(function()
- avatar.Image = Players:GetUserThumbnailAsync(Players.LocalPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48)
- end)
- local pName = Instance.new("TextLabel", profileFrame)
- pName.Size = UDim2.new(1, -65, 0, 20)
- pName.Position = UDim2.new(0, 60, 0, 15)
- pName.BackgroundTransparency = 1
- pName.Text = Players.LocalPlayer and Players.LocalPlayer.Name or "User"
- pName.TextColor3 = Theme.Text
- pName.Font = Enum.Font.GothamMedium
- pName.TextSize = 13
- pName.TextXAlignment = Enum.TextXAlignment.Left
- local pExp = Instance.new("TextLabel", profileFrame)
- pExp.Size = UDim2.new(1, -65, 0, 15)
- pExp.Position = UDim2.new(0, 60, 0, 35)
- pExp.BackgroundTransparency = 1
- pExp.Text = "Expires: <font color='#AA82FF'>Never</font>"
- pExp.RichText = true
- pExp.TextColor3 = Theme.SubText
- pExp.Font = Enum.Font.Gotham
- pExp.TextSize = 11
- pExp.TextXAlignment = Enum.TextXAlignment.Left
- local contentContainer = Instance.new("Frame", mainFrame)
- contentContainer.Size = UDim2.new(1, -sideWidth, 1, 0)
- contentContainer.Position = UDim2.new(0, sideWidth, 0, 0)
- contentContainer.BackgroundTransparency = 1
- local window = {Tabs = {}, ActiveTab = nil}
- local function BuildElements(obj, container)
- function obj:Button(name, callback)
- local btn = Instance.new("TextButton", container)
- btn.Size = UDim2.new(1, 0, 0, 35)
- btn.BackgroundColor3 = Theme.ItemBg
- btn.Text = name
- btn.TextColor3 = Theme.Text
- btn.Font = Enum.Font.GothamMedium
- btn.TextSize = 13
- Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
- btn.MouseEnter:Connect(function() CreateTween(btn, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Color3.fromRGB(40, 40, 40)}) end)
- btn.MouseLeave:Connect(function() CreateTween(btn, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.ItemBg}) end)
- btn.MouseButton1Click:Connect(function() pcall(callback) end)
- end
- function obj:Toggle(name, default, callback)
- local togFrame = Instance.new("Frame", container)
- togFrame.Size = UDim2.new(1, 0, 0, 35)
- togFrame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", togFrame)
- label.Size = UDim2.new(1, -60, 1, 0)
- label.BackgroundTransparency = 1
- label.Text = name
- label.TextColor3 = Theme.Text
- label.Font = Enum.Font.GothamMedium
- label.TextSize = 13
- label.TextXAlignment = Enum.TextXAlignment.Left
- local btn = Instance.new("TextButton", togFrame)
- btn.Size = UDim2.new(1, 0, 1, 0)
- btn.BackgroundTransparency = 1
- btn.Text = ""
- local track = Instance.new("Frame", togFrame)
- track.Size = UDim2.new(0, 36, 0, 20)
- track.Position = UDim2.new(1, -36, 0.5, -10)
- track.BackgroundColor3 = Theme.ItemBg
- Instance.new("UICorner", track).CornerRadius = UDim.new(1, 0)
- local circle = Instance.new("Frame", track)
- circle.Size = UDim2.new(0, 14, 0, 14)
- circle.Position = UDim2.new(0, 3, 0.5, -7)
- circle.BackgroundColor3 = Theme.SubText
- Instance.new("UICorner", circle).CornerRadius = UDim.new(1, 0)
- local state = default
- local function fire(cb)
- if state then
- CreateTween(track, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.ItemBg})
- CreateTween(circle, {0.2, Enum.EasingStyle.Quad}, {Position = UDim2.new(1, -17, 0.5, -7), BackgroundColor3 = Theme.Accent})
- else
- CreateTween(track, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.ItemBg})
- CreateTween(circle, {0.2, Enum.EasingStyle.Quad}, {Position = UDim2.new(0, 3, 0.5, -7), BackgroundColor3 = Theme.SubText})
- end
- if cb then pcall(callback, state) end
- end
- btn.MouseButton1Click:Connect(function()
- state = not state
- fire(true)
- end)
- fire(false)
- end
- function obj:Slider(name, min, max, callback)
- local sliderFrame = Instance.new("Frame", container)
- sliderFrame.Size = UDim2.new(1, 0, 0, 45)
- sliderFrame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", sliderFrame)
- label.Size = UDim2.new(1, -50, 0, 20)
- label.BackgroundTransparency = 1
- label.Text = name
- label.TextColor3 = Theme.Text
- label.Font = Enum.Font.GothamMedium
- label.TextSize = 13
- label.TextXAlignment = Enum.TextXAlignment.Left
- local valLabel = Instance.new("TextLabel", sliderFrame)
- valLabel.Size = UDim2.new(0, 40, 0, 20)
- valLabel.Position = UDim2.new(1, -40, 0, 0)
- valLabel.BackgroundTransparency = 1
- valLabel.Text = tostring(min)
- valLabel.TextColor3 = Theme.SubText
- valLabel.Font = Enum.Font.Gotham
- valLabel.TextSize = 12
- valLabel.TextXAlignment = Enum.TextXAlignment.Right
- local trackBox = Instance.new("TextButton", sliderFrame)
- trackBox.Size = UDim2.new(1, -40, 0, 20)
- trackBox.Position = UDim2.new(0, 0, 0, 20)
- trackBox.BackgroundTransparency = 1
- trackBox.Text = ""
- local track = Instance.new("Frame", trackBox)
- track.Size = UDim2.new(1, 0, 0, 6)
- track.Position = UDim2.new(0, 0, 0.5, -3)
- track.BackgroundColor3 = Theme.ItemBg
- Instance.new("UICorner", track).CornerRadius = UDim.new(1, 0)
- local fill = Instance.new("Frame", track)
- fill.Size = UDim2.new(0, 0, 1, 0)
- fill.BackgroundColor3 = Theme.Accent
- Instance.new("UICorner", fill).CornerRadius = UDim.new(1, 0)
- local grabber = Instance.new("Frame", fill)
- grabber.Size = UDim2.new(0, 12, 0, 12)
- grabber.Position = UDim2.new(1, -6, 0.5, -6)
- grabber.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Instance.new("UICorner", grabber).CornerRadius = UDim.new(1, 0)
- local dragging = false
- local function update(input)
- local pct = math.clamp((input.Position.X - track.AbsolutePosition.X) / track.AbsoluteSize.X, 0, 1)
- local val = math.floor(min + ((max - min) * pct))
- CreateTween(fill, {0.1, Enum.EasingStyle.Sine}, {Size = UDim2.new(pct, 0, 1, 0)})
- valLabel.Text = tostring(val)
- pcall(callback, val)
- end
- trackBox.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- update(input)
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then update(input) end
- end)
- end
- function obj:Dropdown(name, list, callback)
- local HEADER_H = 38
- local ITEM_H = 32
- local ITEM_GAP = 3
- local PADDING_V = 6
- local expandedHeight = HEADER_H + PADDING_V + (#list * (ITEM_H + ITEM_GAP))
- local wrapper = Instance.new("Frame", container)
- wrapper.Size = UDim2.new(1, 0, 0, HEADER_H)
- wrapper.BackgroundTransparency = 1
- wrapper.ClipsDescendants = false
- local dropFrame = Instance.new("Frame", wrapper)
- dropFrame.Size = UDim2.new(1, 0, 0, HEADER_H)
- dropFrame.BackgroundColor3 = Theme.ItemBg
- dropFrame.BorderSizePixel = 0
- dropFrame.ClipsDescendants = true
- dropFrame.ZIndex = 10
- local dropCorner = Instance.new("UICorner", dropFrame)
- dropCorner.CornerRadius = UDim.new(0, 8)
- local dropStroke = Instance.new("UIStroke", dropFrame)
- dropStroke.Color = Color3.fromRGB(45, 45, 45)
- dropStroke.Thickness = 1
- dropStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- local headerBtn = Instance.new("TextButton", dropFrame)
- headerBtn.Size = UDim2.new(1, 0, 0, HEADER_H)
- headerBtn.BackgroundTransparency = 1
- headerBtn.Text = ""
- headerBtn.ZIndex = 12
- local selectedLabel = Instance.new("TextLabel", headerBtn)
- selectedLabel.Size = UDim2.new(1, -48, 1, 0)
- selectedLabel.Position = UDim2.new(0, 14, 0, 0)
- selectedLabel.BackgroundTransparency = 1
- selectedLabel.Text = name
- selectedLabel.TextColor3 = Theme.SubText
- selectedLabel.Font = Enum.Font.GothamMedium
- selectedLabel.TextSize = 13
- selectedLabel.TextXAlignment = Enum.TextXAlignment.Left
- selectedLabel.ZIndex = 13
- local iconContainer = Instance.new("Frame", headerBtn)
- iconContainer.Size = UDim2.new(0, 20, 0, 20)
- iconContainer.Position = UDim2.new(1, -32, 0.5, -10)
- iconContainer.BackgroundTransparency = 1
- iconContainer.ZIndex = 13
- local chevronIcon = Instance.new("ImageLabel", iconContainer)
- chevronIcon.Size = UDim2.new(1, 0, 1, 0)
- chevronIcon.BackgroundTransparency = 1
- chevronIcon.Image = "rbxassetid://7072717851"
- chevronIcon.ImageColor3 = Theme.SubText
- chevronIcon.ZIndex = 14
- pcall(function()
- local HttpService = game:GetService("HttpService")
- local svgUrl = "https://api.iconify.design/lucide/chevron-down.svg?color=%23888888&width=20&height=20"
- local imgLabel = Instance.new("ImageLabel", iconContainer)
- imgLabel.Size = UDim2.new(1, 0, 1, 0)
- imgLabel.BackgroundTransparency = 1
- imgLabel.ZIndex = 15
- local contentId = game:GetService("ContentProvider")
- imgLabel.Image = svgUrl
- chevronIcon.Visible = false
- end)
- local divider = Instance.new("Frame", dropFrame)
- divider.Size = UDim2.new(1, -28, 0, 1)
- divider.Position = UDim2.new(0, 14, 0, HEADER_H)
- divider.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- divider.BorderSizePixel = 0
- divider.BackgroundTransparency = 1
- divider.ZIndex = 11
- local itemsFrame = Instance.new("Frame", dropFrame)
- itemsFrame.Size = UDim2.new(1, 0, 1, -HEADER_H - PADDING_V)
- itemsFrame.Position = UDim2.new(0, 0, 0, HEADER_H + PADDING_V)
- itemsFrame.BackgroundTransparency = 1
- itemsFrame.ZIndex = 11
- local itemLayout = Instance.new("UIListLayout", itemsFrame)
- itemLayout.Padding = UDim.new(0, ITEM_GAP)
- itemLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- local itemsPadding = Instance.new("UIPadding", itemsFrame)
- itemsPadding.PaddingLeft = UDim.new(0, 8)
- itemsPadding.PaddingRight = UDim.new(0, 8)
- local selectedItem = nil
- local expanded = false
- local function setExpanded(state)
- expanded = state
- wrapper.Size = UDim2.new(1, 0, 0, state and expandedHeight or HEADER_H)
- CreateTween(dropFrame, {0.35, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out}, {
- Size = UDim2.new(1, 0, 0, state and expandedHeight or HEADER_H)
- })
- CreateTween(dropStroke, {0.2, Enum.EasingStyle.Quad}, {
- Color = state and Theme.Accent or Color3.fromRGB(45, 45, 45)
- })
- CreateTween(divider, {0.2, Enum.EasingStyle.Quad}, {
- BackgroundTransparency = state and 0 or 1
- })
- CreateTween(chevronIcon, {0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out}, {
- Rotation = state and 180 or 0,
- ImageColor3 = state and Theme.Accent or Theme.SubText
- })
- if state then
- CreateTween(dropFrame, {0.1, Enum.EasingStyle.Quad}, {BackgroundColor3 = Color3.fromRGB(34, 34, 34)})
- else
- CreateTween(dropFrame, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.ItemBg})
- end
- end
- headerBtn.MouseButton1Click:Connect(function()
- setExpanded(not expanded)
- end)
- headerBtn.MouseEnter:Connect(function()
- if not expanded then
- CreateTween(dropFrame, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Color3.fromRGB(36, 36, 36)})
- end
- end)
- headerBtn.MouseLeave:Connect(function()
- if not expanded then
- CreateTween(dropFrame, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.ItemBg})
- end
- end)
- for i, item in ipairs(list) do
- local iFrame = Instance.new("Frame", itemsFrame)
- iFrame.Size = UDim2.new(1, 0, 0, ITEM_H)
- iFrame.BackgroundColor3 = Theme.SectionBg
- iFrame.BorderSizePixel = 0
- iFrame.ZIndex = 12
- local iCorner = Instance.new("UICorner", iFrame)
- iCorner.CornerRadius = UDim.new(0, 6)
- local iDot = Instance.new("Frame", iFrame)
- iDot.Size = UDim2.new(0, 4, 0, 4)
- iDot.Position = UDim2.new(0, 10, 0.5, -2)
- iDot.BackgroundColor3 = Theme.SubText
- iDot.BorderSizePixel = 0
- iDot.ZIndex = 13
- Instance.new("UICorner", iDot).CornerRadius = UDim.new(1, 0)
- local iLabel = Instance.new("TextLabel", iFrame)
- iLabel.Size = UDim2.new(1, -40, 1, 0)
- iLabel.Position = UDim2.new(0, 22, 0, 0)
- iLabel.BackgroundTransparency = 1
- iLabel.Text = item
- iLabel.TextColor3 = Theme.SubText
- iLabel.Font = Enum.Font.Gotham
- iLabel.TextSize = 12
- iLabel.TextXAlignment = Enum.TextXAlignment.Left
- iLabel.ZIndex = 13
- local iCheck = Instance.new("Frame", iFrame)
- iCheck.Size = UDim2.new(0, 6, 0, 6)
- iCheck.Position = UDim2.new(1, -16, 0.5, -3)
- iCheck.BackgroundColor3 = Theme.Accent
- iCheck.BackgroundTransparency = 1
- iCheck.BorderSizePixel = 0
- iCheck.ZIndex = 13
- Instance.new("UICorner", iCheck).CornerRadius = UDim.new(1, 0)
- local iBtn = Instance.new("TextButton", iFrame)
- iBtn.Size = UDim2.new(1, 0, 1, 0)
- iBtn.BackgroundTransparency = 1
- iBtn.Text = ""
- iBtn.ZIndex = 14
- iBtn.MouseEnter:Connect(function()
- CreateTween(iFrame, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Color3.fromRGB(35, 35, 35)})
- CreateTween(iLabel, {0.15, Enum.EasingStyle.Quad}, {TextColor3 = Theme.Text})
- CreateTween(iDot, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.Accent})
- end)
- iBtn.MouseLeave:Connect(function()
- if selectedItem ~= item then
- CreateTween(iFrame, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.SectionBg})
- CreateTween(iLabel, {0.15, Enum.EasingStyle.Quad}, {TextColor3 = Theme.SubText})
- CreateTween(iDot, {0.15, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.SubText})
- end
- end)
- iBtn.MouseButton1Click:Connect(function()
- if selectedItem then
- for _, child in ipairs(itemsFrame:GetChildren()) do
- if child:IsA("Frame") then
- local lbl = child:FindFirstChildOfClass("TextLabel")
- local dot = child:FindFirstChildWhichIsA("Frame")
- local chk = child:FindFirstChild("Frame")
- CreateTween(child, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.SectionBg})
- if lbl then CreateTween(lbl, {0.2, Enum.EasingStyle.Quad}, {TextColor3 = Theme.SubText}) end
- end
- end
- end
- selectedItem = item
- CreateTween(iFrame, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Color3.fromRGB(38, 28, 55)})
- CreateTween(iLabel, {0.2, Enum.EasingStyle.Quad}, {TextColor3 = Theme.Accent})
- CreateTween(iDot, {0.2, Enum.EasingStyle.Quad}, {BackgroundColor3 = Theme.Accent})
- CreateTween(iCheck, {0.2, Enum.EasingStyle.Back}, {BackgroundTransparency = 0})
- CreateTween(selectedLabel, {0.15, Enum.EasingStyle.Quad}, {TextTransparency = 1})
- task.wait(0.12)
- selectedLabel.Text = item
- selectedLabel.TextColor3 = Theme.Text
- CreateTween(selectedLabel, {0.15, Enum.EasingStyle.Quad}, {TextTransparency = 0})
- task.wait(0.1)
- setExpanded(false)
- pcall(callback, item)
- end)
- end
- setExpanded(false)
- end
- function obj:Input(name, callback)
- local inFrame = Instance.new("Frame", container)
- inFrame.Size = UDim2.new(1, 0, 0, 40)
- inFrame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", inFrame)
- label.Size = UDim2.new(0.5, 0, 1, 0)
- label.BackgroundTransparency = 1
- label.Text = name
- label.TextColor3 = Theme.Text
- label.Font = Enum.Font.GothamMedium
- label.TextSize = 13
- label.TextXAlignment = Enum.TextXAlignment.Left
- local box = Instance.new("TextBox", inFrame)
- box.Size = UDim2.new(0.5, 0, 0, 30)
- box.Position = UDim2.new(0.5, 0, 0, 5)
- box.BackgroundColor3 = Theme.ItemBg
- box.Text = ""
- box.PlaceholderText = "..."
- box.TextColor3 = Theme.Text
- box.PlaceholderColor3 = Theme.SubText
- box.Font = Enum.Font.Gotham
- box.TextSize = 12
- box.ClearTextOnFocus = false
- Instance.new("UICorner", box).CornerRadius = UDim.new(0, 6)
- box.FocusLost:Connect(function(e) if e then pcall(callback, box.Text) end end)
- end
- end
- function window:Tab(name)
- local tabBtn = Instance.new("TextButton", tabContainer)
- tabBtn.Size = UDim2.new(1, -24, 0, 36)
- tabBtn.BackgroundColor3 = Theme.Accent
- tabBtn.BackgroundTransparency = 1
- tabBtn.Text = " " .. name
- tabBtn.TextColor3 = Theme.SubText
- tabBtn.Font = Enum.Font.GothamMedium
- tabBtn.TextSize = 13
- tabBtn.TextXAlignment = Enum.TextXAlignment.Left
- Instance.new("UICorner", tabBtn).CornerRadius = UDim.new(0, 6)
- local line = Instance.new("Frame", tabBtn)
- line.Size = UDim2.new(0, 3, 0, 0)
- line.Position = UDim2.new(1, 10, 0.5, 0)
- line.BackgroundColor3 = Theme.Accent
- line.BorderSizePixel = 0
- Instance.new("UICorner", line).CornerRadius = UDim.new(1, 0)
- local tabContent = Instance.new("ScrollingFrame", contentContainer)
- tabContent.Size = UDim2.new(1, -40, 1, -60)
- tabContent.Position = UDim2.new(0, 20, 0, 45)
- tabContent.BackgroundTransparency = 1
- tabContent.Visible = false
- tabContent.ScrollBarThickness = 2
- tabContent.ScrollBarImageColor3 = Theme.ItemBg
- tabContent.AutomaticCanvasSize = Enum.AutomaticSize.Y
- tabContent.CanvasSize = UDim2.new(0, 0, 0, 0)
- local layout = Instance.new("UIListLayout", tabContent)
- layout.Padding = UDim.new(0, 12)
- local tabObj = {}
- table.insert(window.Tabs, {Btn = tabBtn, Content = tabContent, Line = line})
- tabBtn.MouseButton1Click:Connect(function()
- for _, t in ipairs(window.Tabs) do
- t.Content.Visible = false
- CreateTween(t.Btn, {0.3, Enum.EasingStyle.Quad}, {BackgroundTransparency = 1, TextColor3 = Theme.SubText})
- CreateTween(t.Line, {0.3, Enum.EasingStyle.Exponential}, {Size = UDim2.new(0, 3, 0, 0), Position = UDim2.new(1, 10, 0.5, 0)})
- end
- tabContent.Visible = true
- CreateTween(tabBtn, {0.3, Enum.EasingStyle.Quad}, {BackgroundTransparency = 0, TextColor3 = Theme.DarkText})
- CreateTween(line, {0.3, Enum.EasingStyle.Exponential}, {Size = UDim2.new(0, 3, 0, 18), Position = UDim2.new(1, 10, 0.5, -9)})
- end)
- if not self.ActiveTab then
- self.ActiveTab = tabContent
- tabContent.Visible = true
- tabBtn.BackgroundTransparency = 0
- tabBtn.TextColor3 = Theme.DarkText
- line.Size = UDim2.new(0, 3, 0, 18)
- line.Position = UDim2.new(1, 10, 0.5, -9)
- end
- function tabObj:Section(secName)
- local secFrame = Instance.new("Frame", tabContent)
- secFrame.Size = UDim2.new(1, 0, 0, 45)
- secFrame.BackgroundColor3 = Theme.SectionBg
- Instance.new("UICorner", secFrame).CornerRadius = UDim.new(0, 8)
- local secTitle = Instance.new("TextLabel", secFrame)
- secTitle.Size = UDim2.new(1, -30, 0, 25)
- secTitle.Position = UDim2.new(0, 15, 0, 10)
- secTitle.BackgroundTransparency = 1
- secTitle.Text = secName
- secTitle.TextColor3 = Theme.Text
- secTitle.Font = Enum.Font.GothamBold
- secTitle.TextSize = 13
- secTitle.TextXAlignment = Enum.TextXAlignment.Left
- local secDivider = Instance.new("Frame", secFrame)
- secDivider.Size = UDim2.new(1, -30, 0, 1)
- secDivider.Position = UDim2.new(0, 15, 0, 35)
- secDivider.BackgroundColor3 = Theme.ItemBg
- secDivider.BorderSizePixel = 0
- local secItems = Instance.new("Frame", secFrame)
- secItems.Size = UDim2.new(1, -30, 1, -45)
- secItems.Position = UDim2.new(0, 15, 0, 45)
- secItems.BackgroundTransparency = 1
- local secLayout = Instance.new("UIListLayout", secItems)
- secLayout.Padding = UDim.new(0, 8)
- secLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- secFrame.Size = UDim2.new(1, 0, 0, secLayout.AbsoluteContentSize.Y + 55)
- end)
- local secObj = {}
- BuildElements(secObj, secItems)
- return secObj
- end
- BuildElements(tabObj, tabContent)
- return tabObj
- end
- local loaderObj = {}
- if sysConfig.Loader then
- local loaderContainer = Instance.new("Frame", mainFrame)
- loaderContainer.Size = UDim2.new(1, 0, 1, 0)
- loaderContainer.BackgroundTransparency = 1
- loaderContainer.ZIndex = 200
- local leftPanel = Instance.new("Frame", loaderContainer)
- leftPanel.Size = UDim2.new(0.5, 0, 1, 0)
- leftPanel.Position = UDim2.new(0, 0, 0, 0)
- leftPanel.BackgroundColor3 = Theme.MainBg
- leftPanel.BorderSizePixel = 0
- leftPanel.ZIndex = 201
- local rightPanel = Instance.new("Frame", loaderContainer)
- rightPanel.Size = UDim2.new(0.5, 0, 1, 0)
- rightPanel.Position = UDim2.new(0.5, 0, 0, 0)
- rightPanel.BackgroundColor3 = Theme.MainBg
- rightPanel.BorderSizePixel = 0
- rightPanel.ZIndex = 201
- local centerLine = Instance.new("Frame", loaderContainer)
- centerLine.Size = UDim2.new(0, 2, 1, 0)
- centerLine.Position = UDim2.new(0.5, -1, 0, 0)
- centerLine.BackgroundColor3 = Theme.Accent
- centerLine.BorderSizePixel = 0
- centerLine.ZIndex = 202
- local loaderText = Instance.new("TextLabel", loaderContainer)
- loaderText.Size = UDim2.new(1, 0, 1, 0)
- loaderText.BackgroundTransparency = 1
- loaderText.Text = "Loading Engine..."
- loaderText.TextColor3 = Theme.Text
- loaderText.Font = Enum.Font.GothamMedium
- loaderText.TextSize = 16
- loaderText.ZIndex = 205
- local isStarted = false
- local isEnded = false
- function loaderObj:Start()
- isStarted = true
- loaderContainer.Visible = true
- task.spawn(function()
- while not isEnded do
- CreateTween(centerLine, {0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut}, {BackgroundTransparency = 0.8})
- task.wait(0.5)
- CreateTween(centerLine, {0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut}, {BackgroundTransparency = 0})
- task.wait(0.5)
- end
- end)
- end
- function loaderObj:SetText(txt)
- if isStarted and not isEnded then
- CreateTween(loaderText, {0.15, Enum.EasingStyle.Quad}, {TextTransparency = 1})
- task.wait(0.15)
- loaderText.Text = txt
- CreateTween(loaderText, {0.15, Enum.EasingStyle.Quad}, {TextTransparency = 0})
- end
- end
- function loaderObj:End()
- if isStarted and not isEnded then
- isEnded = true
- CreateTween(loaderText, {0.2, Enum.EasingStyle.Quad}, {TextTransparency = 1})
- CreateTween(centerLine, {0.3, Enum.EasingStyle.Exponential}, {Size = UDim2.new(0, 2, 0, 0), Position = UDim2.new(0.5, -1, 0.5, 0)})
- task.wait(0.3)
- CreateTween(leftPanel, {0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut}, {Position = UDim2.new(-0.5, 0, 0, 0)})
- CreateTween(rightPanel, {0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut}, {Position = UDim2.new(1, 0, 0, 0)})
- task.delay(0.6, function()
- loaderContainer:Destroy()
- end)
- end
- end
- loaderObj:Start()
- else
- loaderObj = nil
- end
- return window, loaderObj
- end
- return Library
Add Comment
Please, Sign In to add comment