Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local AtlastobyLib = {}
- function AtlastobyLib:MakeWindow(options)
- options = options or {}
- local player = game.Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "atlastoby_gui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = playerGui
- -- Main Title Label (Title Frame)
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Name = "TitleLabel"
- titleLabel.Parent = screenGui
- titleLabel.Size = UDim2.new(0, 639, 0, 50)
- titleLabel.Position = UDim2.new(0.10209, 0, 0.08825, 0)
- titleLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- titleLabel.BorderSizePixel = 0
- titleLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
- titleLabel.Text = options.Name or "ATLASTOBY UI"
- titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- titleLabel.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
- titleLabel.TextStrokeTransparency = 0
- titleLabel.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- titleLabel.TextScaled = true
- titleLabel.TextWrapped = true
- titleLabel.TextSize = 14
- -- Title Label Stroke
- local titleStroke = Instance.new("UIStroke")
- titleStroke.Parent = titleLabel
- titleStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- titleStroke.Thickness = 5
- -- Background Panel (main_panel)
- local mainPanel = Instance.new("ImageLabel")
- mainPanel.Name = "main_panel"
- mainPanel.Parent = titleLabel
- mainPanel.Size = UDim2.new(0, 639, 0, 412)
- mainPanel.Position = UDim2.new(-0.00119, 0, 1.00849, 0)
- mainPanel.BackgroundTransparency = 1
- mainPanel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- mainPanel.BorderSizePixel = 0
- mainPanel.BorderColor3 = Color3.fromRGB(0, 0, 0)
- mainPanel.Image = "http://www.roblox.com/asset/?id=99003730285484"
- mainPanel.ImageTransparency = 0.15
- -- Background Panel Stroke
- local panelStroke = Instance.new("UIStroke")
- panelStroke.Parent = mainPanel
- panelStroke.Thickness = 4
- -- Side Scrolling Frame (like a menu)
- local sideMenu = Instance.new("ScrollingFrame")
- sideMenu.Name = "SideMenu"
- sideMenu.Parent = titleLabel
- sideMenu.Size = UDim2.new(0, 214, 0, 394)
- sideMenu.Position = UDim2.new(0.01252, 0, 1.24, 0)
- sideMenu.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- sideMenu.BorderSizePixel = 0
- sideMenu.BorderColor3 = Color3.fromRGB(0, 0, 0)
- sideMenu.Active = true
- sideMenu.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
- -- Side Menu Stroke
- local sideMenuStroke = Instance.new("UIStroke")
- sideMenuStroke.Parent = sideMenu
- sideMenuStroke.Thickness = 2
- -- Red Close Button
- local closeButton = Instance.new("TextButton")
- closeButton.Name = "CloseButton"
- closeButton.Parent = titleLabel
- closeButton.Size = UDim2.new(0, 25, 0, 25)
- closeButton.Position = UDim2.new(1, -30, 0.5, -12)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.BorderSizePixel = 0
- closeButton.Text = ""
- closeButton.AutoButtonColor = true
- closeButton.TextScaled = true
- closeButton.TextColor3 = Color3.new(1, 1, 1)
- closeButton.ClipsDescendants = true
- closeButton.AnchorPoint = Vector2.new(0.5, 0.5)
- local closeCorner = Instance.new("UICorner")
- closeCorner.Parent = closeButton
- closeCorner.CornerRadius = UDim.new(1, 0) -- make it a circle
- closeButton.MouseButton1Click:Connect(function()
- -- Hide the entire UI instead of destroying it
- screenGui.Enabled = false
- end)
- -- Orange Minimize Button
- local minimizeButton = Instance.new("TextButton")
- minimizeButton.Name = "MinimizeButton"
- minimizeButton.Parent = titleLabel
- minimizeButton.Size = UDim2.new(0, 25, 0, 25)
- minimizeButton.Position = UDim2.new(1, -65, 0.5, -12)
- minimizeButton.BackgroundColor3 = Color3.fromRGB(255, 165, 0)
- minimizeButton.BorderSizePixel = 0
- minimizeButton.Text = ""
- minimizeButton.AutoButtonColor = true
- minimizeButton.TextScaled = true
- minimizeButton.TextColor3 = Color3.new(1, 1, 1)
- minimizeButton.ClipsDescendants = true
- minimizeButton.AnchorPoint = Vector2.new(0.5, 0.5)
- local minimizeCorner = Instance.new("UICorner")
- minimizeCorner.Parent = minimizeButton
- minimizeCorner.CornerRadius = UDim.new(1, 0)
- -- Maximize Button (Hidden initially)
- local maximizeButton = Instance.new("TextButton")
- maximizeButton.Name = "MaximizeButton"
- maximizeButton.Parent = screenGui
- maximizeButton.Size = UDim2.new(0, 100, 0, 30)
- maximizeButton.Position = UDim2.new(0, 10, 0.5, 0)
- maximizeButton.BackgroundColor3 = Color3.fromRGB(255, 165, 0)
- maximizeButton.BorderSizePixel = 0
- maximizeButton.Text = "Maximize"
- maximizeButton.TextScaled = true
- maximizeButton.TextColor3 = Color3.new(1, 1, 1)
- maximizeButton.Visible = false
- local maximizeCorner = Instance.new("UICorner")
- maximizeCorner.Parent = maximizeButton
- maximizeCorner.CornerRadius = UDim.new(0.25, 0)
- minimizeButton.MouseButton1Click:Connect(function()
- -- Hide all UI except Maximize
- for _, v in ipairs(screenGui:GetChildren()) do
- if v ~= maximizeButton then
- v.Visible = false
- end
- end
- maximizeButton.Visible = true
- end)
- maximizeButton.MouseButton1Click:Connect(function()
- -- Restore UI
- for _, v in ipairs(screenGui:GetChildren()) do
- if v ~= maximizeButton then
- v.Visible = true
- end
- end
- maximizeButton.Visible = false
- end)
- -- Draggable title (titleLabel)
- local dragging = false
- local dragInput, dragStart, startPos
- titleLabel.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = titleLabel.Position
- end
- end)
- titleLabel.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- titleLabel.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- titleLabel.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- return {
- ScreenGui = screenGui,
- Title = titleLabel,
- MainPanel = mainPanel,
- SideMenu = sideMenu
- }
- end
- -- Function to create custom buttons dynamically
- function AtlastobyLib:CreateCustomButton(buttonText, buttonColor, onClickAction)
- -- Get the local player’s PlayerGui
- local player = game:GetService("Players").LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- -- Get the main GUI and title frame
- local atlastobyGui = playerGui:WaitForChild("atlastoby_gui") -- Assuming the main gui is called atlastoby_gui
- local titleGui = atlastobyGui:WaitForChild("TextLabel") -- Assuming title frame is a TextLabel
- local sideMenu = atlastobyGui:WaitForChild("ScrollingFrame") -- The side menu (scrolling frame)
- -- Create a new button
- local customButton = Instance.new("TextButton")
- customButton.Name = "CustomButton"
- customButton.Parent = sideMenu
- customButton.Size = UDim2.new(0, 200, 0, 50) -- Default size for buttons
- customButton.Position = UDim2.new(0.5, -100, 0, #sideMenu:GetChildren() * 60) -- Automatically stacked buttons
- customButton.BackgroundColor3 = buttonColor
- customButton.BorderSizePixel = 0
- customButton.Text = buttonText
- customButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- customButton.TextScaled = true
- -- Connect the onClick action to the button
- customButton.MouseButton1Click:Connect(function()
- if onClickAction then
- onClickAction()
- end
- end)
- end
- return AtlastobyLib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement