Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Library = {}
- local tweenservice = game:GetService("TweenService")
- local player: Player = game.Players.LocalPlayer
- local mouse: Mouse = player:GetMouse()
- function dropdownFunction(dropdown: ImageButton, subject: Frame | {Frame}, status: boolean)
- local rotation: number = status and 0 or 180
- local tween: Tween = tweenservice:Create(dropdown, TweenInfo.new(.2), {Rotation = rotation})
- if typeof(subject) == "table" then
- for _, subj: Frame in pairs(subject) do
- subj.Visible = status
- end
- else
- subject.Visible = status
- end
- tween:Play()
- end
- function Library:CreateWindow(ui_title: string)
- local UILib = {}
- local UI = Instance.new("ScreenGui")
- local Tabs = Instance.new("ImageLabel")
- local UIListLayout_1 = Instance.new("UIListLayout")
- local UIStroke_1 = Instance.new("UIStroke")
- local Title = Instance.new("Frame")
- local MainTitle = Instance.new("TextLabel")
- local Exit = Instance.new("ImageButton")
- local UIAspectRatioConstraint_1 = Instance.new("UIAspectRatioConstraint")
- local Dropdown_1 = Instance.new("ImageButton")
- local UIAspectRatioConstraint_2 = Instance.new("UIAspectRatioConstraint")
- local UIStroke_2 = Instance.new("UIStroke")
- local UICorner_1 = Instance.new("UICorner")
- local UICorner_2 = Instance.new("UICorner")
- UI.Name = "UI"
- UI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- Tabs.Name = "Tabs"
- Tabs.Parent = UI
- Tabs.Active = true
- Tabs.Draggable = true
- Tabs.AnchorPoint = Vector2.new(0.5, 0.5)
- Tabs.AutomaticSize = Enum.AutomaticSize.Y
- Tabs.BorderColor3 = Color3.fromRGB(20,20,20)
- Tabs.BorderSizePixel = 3
- Tabs.Position = UDim2.new(0.5, 0,0.5, 0)
- Tabs.Size = UDim2.new(0, 180,0, 0)
- Tabs.Image = "rbxassetid://823352249"
- Tabs.ImageColor3 = Color3.fromRGB(150,150,150)
- Tabs.ScaleType = Enum.ScaleType.Crop
- UIListLayout_1.Parent = Tabs
- UIListLayout_1.HorizontalAlignment = Enum.HorizontalAlignment.Center
- UIListLayout_1.SortOrder = Enum.SortOrder.LayoutOrder
- UIStroke_1.Parent = Tabs
- UIStroke_1.Color = Color3.fromRGB(40,40,40)
- UIStroke_1.LineJoinMode = Enum.LineJoinMode.Miter
- UIStroke_1.Thickness = 1
- Title.Name = "Title"
- Title.Parent = Tabs
- Title.BackgroundTransparency = 1
- Title.Size = UDim2.new(1, 0,0, 20)
- MainTitle.Name = "Main"
- MainTitle.Parent = Title
- MainTitle.AnchorPoint = Vector2.new(0.5, 0.5)
- MainTitle.BackgroundTransparency = 1
- MainTitle.Position = UDim2.new(0.417, 0,0.5, 0)
- MainTitle.Size = UDim2.new(0.834, -14,0, 14)
- MainTitle.Font = Enum.Font.ArialBold
- MainTitle.Text = ui_title
- MainTitle.TextColor3 = Color3.fromRGB(255,255,255)
- MainTitle.TextSize = 14
- MainTitle.TextWrapped = true
- MainTitle.TextXAlignment = Enum.TextXAlignment.Left
- MainTitle.TextScaled = true
- Exit.Name = "Exit"
- Exit.Parent = Title
- Exit.AnchorPoint = Vector2.new(0.5, 0.5)
- Exit.BackgroundTransparency = 1
- Exit.Position = UDim2.new(0.95, 0,0.5, 0)
- Exit.Size = UDim2.new(0, 14,0, 14)
- Exit.Image = "rbxassetid://7072725342"
- Exit.AutoButtonColor = false
- UICorner_1.Parent = Exit
- UICorner_1.CornerRadius = UDim.new(0, 8)
- UIAspectRatioConstraint_1.Parent = Exit
- Dropdown_1.Name = "Dropdown"
- Dropdown_1.Parent = Title
- Dropdown_1.AnchorPoint = Vector2.new(0.5, 0.5)
- Dropdown_1.BackgroundTransparency = 1
- Dropdown_1.Position = UDim2.new(0.85, 0,0.5, 0)
- Dropdown_1.Size = UDim2.new(0, 14,0, 14)
- Dropdown_1.Image = "rbxassetid://7072706796"
- Dropdown_1.AutoButtonColor = false
- UICorner_2.Parent = Dropdown_1
- UICorner_2.CornerRadius = UDim.new(0, 8)
- UIAspectRatioConstraint_2.Parent = Dropdown_1
- UIStroke_2.Parent = Title
- UIStroke_2.Color = Color3.fromRGB(40,40,40)
- UIStroke_2.LineJoinMode = Enum.LineJoinMode.Miter
- UIStroke_2.Thickness = 1
- Exit.MouseButton1Click:Connect(function()
- UI:Destroy()
- end)
- local titleDropdownStatus: boolean = true
- Dropdown_1.MouseEnter:Connect(function()
- Dropdown_1.BackgroundTransparency = 0.85
- end)
- Dropdown_1.MouseLeave:Connect(function()
- Dropdown_1.BackgroundTransparency = 1
- end)
- Exit.MouseEnter:Connect(function()
- Exit.BackgroundTransparency = 0.85
- end)
- Exit.MouseLeave:Connect(function()
- Exit.BackgroundTransparency = 1
- end)
- Dropdown_1.MouseButton1Click:Connect(function()
- titleDropdownStatus = not titleDropdownStatus
- local tabsInTabs = {}
- for _, tab: Frame in pairs(Tabs:GetChildren()) do
- if tab.Name == "Tab" then
- table.insert(tabsInTabs, tab)
- end
- end
- dropdownFunction(Dropdown_1, tabsInTabs, titleDropdownStatus)
- end)
- function UILib:CreateTab(tab_title: string)
- local TabLib = {}
- local Tab = Instance.new("Frame")
- local UIListLayout_2 = Instance.new("UIListLayout")
- local Title_2 = Instance.new("Frame")
- local MainTab = Instance.new("TextLabel")
- local Dropdown_2 = Instance.new("ImageButton")
- local UIAspectRatioConstraint_3 = Instance.new("UIAspectRatioConstraint")
- local UIPadding_1 = Instance.new("UIPadding")
- local UICorner_3 = Instance.new("UICorner")
- Tab.Name = "Tab"
- Tab.Parent = Tabs
- Tab.AnchorPoint = Vector2.new(0.5, 0.5)
- Tab.AutomaticSize = Enum.AutomaticSize.Y
- Tab.BackgroundTransparency = 1
- Tab.BorderSizePixel = 0
- Tab.Size = UDim2.new(1, 0,0, 20)
- UIListLayout_2.Parent = Tab
- UIListLayout_2.HorizontalAlignment = Enum.HorizontalAlignment.Center
- UIListLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
- UIPadding_1.Parent = Tab
- UIPadding_1.PaddingTop = UDim.new(0,4)
- Title_2.Name = "Title"
- Title_2.Parent = Tab
- Title_2.BackgroundColor3 = Color3.fromRGB(25,25,25)
- Title_2.BorderSizePixel = 0
- Title_2.Size = UDim2.new(1, 0,0, 20)
- MainTab.Name = "Main"
- MainTab.Parent = Title_2
- MainTab.AnchorPoint = Vector2.new(0.5, 0.5)
- MainTab.BackgroundTransparency = 1
- MainTab.Position = UDim2.new(0.464, 0,0.5, 0)
- MainTab.Size = UDim2.new(0.928, -14,0, 14)
- MainTab.Font = Enum.Font.Arial
- MainTab.Text = tab_title
- MainTab.TextColor3 = Color3.fromRGB(255,255,255)
- MainTab.TextSize = 14
- MainTab.TextWrapped = true
- MainTab.TextXAlignment = Enum.TextXAlignment.Left
- MainTab.TextScaled = true
- Dropdown_2.Name = "Dropdown"
- Dropdown_2.Parent = Title_2
- Dropdown_2.AnchorPoint = Vector2.new(0.5, 0.5)
- Dropdown_2.BackgroundTransparency = 1
- Dropdown_2.Position = UDim2.new(0.95, 0,0.5, 0)
- Dropdown_2.Size = UDim2.new(0, 14,0, 14)
- Dropdown_2.Image = "rbxassetid://7072706796"
- Dropdown_2.AutoButtonColor = false
- UICorner_3.Parent = Dropdown_2
- UICorner_3.CornerRadius = UDim.new(0, 8)
- UIAspectRatioConstraint_3.Parent = Dropdown_2
- local tabDropdownStatus: boolean = true
- Dropdown_2.MouseEnter:Connect(function()
- Dropdown_2.BackgroundTransparency = 0.85
- end)
- Dropdown_2.MouseLeave:Connect(function()
- Dropdown_2.BackgroundTransparency = 1
- end)
- Dropdown_2.MouseButton1Click:Connect(function()
- titleDropdownStatus = not titleDropdownStatus
- local containers = {}
- for _, container: Frame in pairs(Tab:GetChildren()) do
- if container.Name == "Container" then
- table.insert(containers, container)
- end
- end
- dropdownFunction(Dropdown_2, containers, titleDropdownStatus)
- end)
- function TabLib:CreateButton(text: string, callback)
- local Container = Instance.new("Frame")
- local Button = Instance.new("Frame")
- local UIStroke_3 = Instance.new("UIStroke")
- local MainButton = Instance.new("TextButton")
- local MousePointer = Instance.new("ImageLabel")
- local UIAspectRatioConstraint_4 = Instance.new("UIAspectRatioConstraint")
- local ButtonText = Instance.new("TextLabel")
- Container.Name = "Container"
- Container.Parent = Tab
- Container.BackgroundTransparency = 1
- Container.Size = UDim2.new(1, 0,0, 40)
- Button.Name = "Button"
- Button.Parent = Container
- Button.AnchorPoint = Vector2.new(0.5, 0.5)
- Button.BackgroundTransparency = 1
- Button.BorderSizePixel = 0
- Button.Position = UDim2.new(0.5, 0,0.5, 0)
- Button.Size = UDim2.new(0.9, 0,0.6, 0)
- MainButton.Name = "Main"
- MainButton.Parent = Button
- MainButton.Active = true
- MainButton.AnchorPoint = Vector2.new(0.5, 0.5)
- MainButton.AutoButtonColor = false
- MainButton.BackgroundColor3 = Color3.fromRGB(25,25,25)
- MainButton.BorderSizePixel = 0
- MainButton.Position = UDim2.new(0.5, 0,0.5, 0)
- MainButton.Size = UDim2.new(1, 0,1, 0)
- MainButton.Font = Enum.Font.Arial
- MainButton.Text = ""
- MainButton.TextColor3 = Color3.fromRGB(255,255,255)
- MainButton.TextSize = 14
- MainButton.ClipsDescendants = true
- UIStroke_3.Parent = Button
- UIStroke_3.Color = Color3.fromRGB(40,40,40)
- UIStroke_3.LineJoinMode = Enum.LineJoinMode.Miter
- UIStroke_3.Thickness = 1
- MousePointer.Name = "MousePointer"
- MousePointer.Parent = Button
- MousePointer.AnchorPoint = Vector2.new(0.5, 0.5)
- MousePointer.BackgroundColor3 = Color3.fromRGB(163,162,165)
- MousePointer.BackgroundTransparency = 1
- MousePointer.BorderColor3 = Color3.fromRGB(27,42,53)
- MousePointer.Position = UDim2.new(0.925000012, 0,0.5, 0)
- MousePointer.Size = UDim2.new(0, 12,0, 12)
- MousePointer.Image = "rbxassetid://7072719587"
- UIAspectRatioConstraint_4.Parent = MousePointer
- ButtonText.Name = "Text"
- ButtonText.Parent = Button
- ButtonText.AnchorPoint = Vector2.new(0.5, 0.5)
- ButtonText.BackgroundColor3 = Color3.fromRGB(255,255,255)
- ButtonText.BackgroundTransparency = 1
- ButtonText.BorderColor3 = Color3.fromRGB(27,42,53)
- ButtonText.Position = UDim2.new(0.375, 0,0.5, 0)
- ButtonText.Size = UDim2.new(0.649999976, 0,0, 14)
- ButtonText.Font = Enum.Font.Arial
- ButtonText.Text = text
- ButtonText.TextColor3 = Color3.fromRGB(255,255,255)
- ButtonText.TextSize = 12
- ButtonText.TextWrapped = true
- ButtonText.TextXAlignment = Enum.TextXAlignment.Left
- MainButton.MouseButton1Click:Connect(function()
- callback()
- end)
- end
- function TabLib:CreateInput(text: string, callback)
- local Container = Instance.new("Frame")
- local Input = Instance.new("Frame")
- local UIStroke_4 = Instance.new("UIStroke")
- local MainInput = Instance.new("TextBox")
- local Copy = Instance.new("ImageButton")
- local UIAspectRatioConstraint_5 = Instance.new("UIAspectRatioConstraint")
- local UICorner_4 = Instance.new("UICorner")
- Container.Name = "Container"
- Container.Parent = Tab
- Container.BackgroundTransparency = 1
- Container.Size = UDim2.new(1, 0,0, 40)
- Input.Name = "Input"
- Input.Parent = Container
- Input.AnchorPoint = Vector2.new(0.5, 0.5)
- Input.BackgroundColor3 = Color3.fromRGB(25,25,25)
- Input.BorderSizePixel = 0
- Input.Position = UDim2.new(0.5, 0,0.5, 0)
- Input.Size = UDim2.new(0.899999976, 0,0.600000024, 0)
- UIStroke_4.Parent = Input
- UIStroke_4.Color = Color3.fromRGB(40,40,40)
- UIStroke_4.LineJoinMode = Enum.LineJoinMode.Miter
- UIStroke_4.Thickness = 1
- MainInput.Name = "Main"
- MainInput.Parent = Input
- MainInput.Active = true
- MainInput.AnchorPoint = Vector2.new(0.5, 0.5)
- MainInput.BackgroundColor3 = Color3.fromRGB(25,25,25)
- MainInput.BackgroundTransparency = 1
- MainInput.BorderColor3 = Color3.fromRGB(20,20,20)
- MainInput.BorderSizePixel = 0
- MainInput.CursorPosition = -1
- MainInput.Position = UDim2.new(0.447839618, 0,0.5, 0)
- MainInput.Size = UDim2.new(0.795678973, 0,1, 0)
- MainInput.Font = Enum.Font.Arial
- MainInput.PlaceholderColor3 = Color3.fromRGB(140,140,140)
- MainInput.PlaceholderText = text
- MainInput.Text = ""
- MainInput.ClearTextOnFocus = false
- MainInput.TextColor3 = Color3.fromRGB(255,255,255)
- MainInput.TextSize = 14
- MainInput.TextWrapped = true
- MainInput.TextXAlignment = Enum.TextXAlignment.Left
- MainInput.ClipsDescendants = true
- Copy.Name = "Copy"
- Copy.Parent = Input
- Copy.AnchorPoint = Vector2.new(0.5, 0.5)
- Copy.BackgroundColor3 = Color3.fromRGB(163,162,165)
- Copy.BackgroundTransparency = 1
- Copy.BorderColor3 = Color3.fromRGB(27,42,53)
- Copy.Position = UDim2.new(0.925000012, 0,0.5, 0)
- Copy.Size = UDim2.new(0, 12,0, 12)
- Copy.Image = "rbxassetid://7072707198"
- UICorner_4.Parent = Copy
- UICorner_4.CornerRadius = UDim.new(0, 8)
- UIAspectRatioConstraint_5.Parent = Copy
- MainInput.FocusLost:Connect(function(enterPressed)
- if enterPressed then
- callback(MainInput.Text)
- end
- end)
- Copy.MouseEnter:Connect(function()
- Copy.BackgroundTransparency = 0.85
- end)
- Copy.MouseLeave:Connect(function()
- Copy.BackgroundTransparency = 1
- end)
- Copy.MouseButton1Click:Connect(function()
- pcall(function()
- setclipboard(MainInput.Text)
- warn(("copied %s to clipboard"):format(MainInput.Text))
- end)
- end)
- end
- function TabLib:CreateSwitch(text: string, callback)
- local Container = Instance.new("Frame")
- local SwitchText = Instance.new("TextLabel")
- local Switch = Instance.new("Frame")
- local UICorner_5 = Instance.new("UICorner")
- local SwitchBall = Instance.new("Frame")
- local UICorner_6 = Instance.new("UICorner")
- local UIStroke_3 = Instance.new("UIStroke")
- local SwitchButton = Instance.new("TextButton")
- Container.Name = "Container"
- Container.Parent = Tab
- Container.BackgroundTransparency = 1
- Container.Size = UDim2.new(1, 0,0, 40)
- SwitchText.Name = "Text"
- SwitchText.Parent = Container
- SwitchText.AnchorPoint = Vector2.new(0.5, 0.5)
- SwitchText.BackgroundColor3 = Color3.fromRGB(255,255,255)
- SwitchText.BackgroundTransparency = 1
- SwitchText.BorderColor3 = Color3.fromRGB(27,42,53)
- SwitchText.Position = UDim2.new(0.35, 0,0.5, 0)
- SwitchText.Size = UDim2.new(0.6, 0,0.6, 0)
- SwitchText.Font = Enum.Font.Arial
- SwitchText.Text = text
- SwitchText.TextColor3 = Color3.fromRGB(255,255,255)
- SwitchText.TextSize = 14
- SwitchText.TextXAlignment = Enum.TextXAlignment.Left
- SwitchText.TextWrapped = true
- Switch.Name = "Switch"
- Switch.Parent = Container
- Switch.AnchorPoint = Vector2.new(0.5, 0.5)
- Switch.BackgroundColor3 = Color3.fromRGB(25,25,25)
- Switch.Position = UDim2.new(0.821, 0,0.5, 0)
- Switch.Size = UDim2.new(0.281, 0,0.55, 0)
- SwitchButton.Name = "SwitchButton"
- SwitchButton.Parent = Switch
- SwitchButton.BackgroundTransparency = 1
- SwitchButton.Text = ""
- SwitchButton.AnchorPoint = Vector2.new(0.5, 0.5)
- SwitchButton.Position = UDim2.new(0.5, 0, 0.5, 0)
- SwitchButton.Size = UDim2.new(1, 0, 1, 0)
- SwitchButton.AutoButtonColor = false
- UIStroke_3.Parent = Switch
- UIStroke_3.Color = Color3.fromRGB(40,40,40)
- UICorner_5.Parent = Switch
- UICorner_5.CornerRadius = UDim.new(1,0)
- SwitchBall.Name = "Ball"
- SwitchBall.Parent = Switch
- SwitchBall.AnchorPoint = Vector2.new(0.5, 0.5)
- SwitchBall.BackgroundColor3 = Color3.fromRGB(255,255,255)
- SwitchBall.BorderColor3 = Color3.fromRGB(27,42,53)
- SwitchBall.Position = UDim2.new(0.25, 0,0.5, 0)
- SwitchBall.Size = UDim2.new(0, 16,0, 16)
- UICorner_6.Parent = SwitchBall
- UICorner_6.CornerRadius = UDim.new(1,123)
- local toggled: boolean = false
- SwitchButton.MouseButton1Click:Connect(function()
- toggled = not toggled
- local ballTweenProperties = toggled and {Position = UDim2.new(0.75, 0, 0.5, 0)} or {Position = UDim2.new(0.25, 0, 0.5, 0)}
- local switchTweenProperties = toggled and {BackgroundColor3 = Color3.fromRGB(0, 200, 255)} or {BackgroundColor3 = Color3.fromRGB(25, 25, 25)}
- local tweenProperties = {{Switch, switchTweenProperties}, {SwitchBall, ballTweenProperties}}
- for _, object in pairs(tweenProperties) do
- local tween: Tween = tweenservice:Create(object[1], TweenInfo.new(.1), object[2])
- tween:Play()
- end
- callback(toggled)
- end)
- end
- return TabLib
- end
- return UILib
- end
- return Library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement