Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local library = {}
- function library:CreateWindow(name)
- local gui = Instance.new("ScreenGui", game:GetService("CoreGui"))
- gui.Name = "MartinUI"
- local main = Instance.new("Frame", gui)
- main.Size = UDim2.new(0, 450, 0, 350)
- main.Position = UDim2.new(0.5, -225, 0.5, -175)
- main.BackgroundColor3 = Color3.fromRGB(25, 25, 35)
- main.BorderSizePixel = 0
- main.AnchorPoint = Vector2.new(0.5, 0.5)
- main.Active = true
- main.Draggable = true
- local corner = Instance.new("UICorner", main)
- corner.CornerRadius = UDim.new(0, 12)
- local title = Instance.new("TextLabel", main)
- title.Size = UDim2.new(1, 0, 0, 40)
- title.BackgroundTransparency = 1
- title.Text = name or "Martin UI"
- title.Font = Enum.Font.GothamBold
- title.TextSize = 20
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- local scrolling = Instance.new("ScrollingFrame", main)
- scrolling.Size = UDim2.new(1, -20, 1, -60)
- scrolling.Position = UDim2.new(0, 10, 0, 50)
- scrolling.BackgroundTransparency = 1
- scrolling.CanvasSize = UDim2.new(0, 0, 0, 0)
- scrolling.ScrollBarThickness = 6
- scrolling.AutomaticCanvasSize = Enum.AutomaticSize.Y
- scrolling.ClipsDescendants = true
- local layout = Instance.new("UIListLayout", scrolling)
- layout.Padding = UDim.new(0, 10)
- layout.SortOrder = Enum.SortOrder.LayoutOrder
- local padding = Instance.new("UIPadding", scrolling)
- padding.PaddingTop = UDim.new(0, 5)
- padding.PaddingBottom = UDim.new(0, 5)
- padding.PaddingLeft = UDim.new(0, 5)
- padding.PaddingRight = UDim.new(0, 5)
- function library:CreateButton(text, callback)
- local btn = Instance.new("TextButton", scrolling)
- btn.Size = UDim2.new(1, -10, 0, 40)
- btn.BackgroundColor3 = Color3.fromRGB(40, 40, 60)
- btn.Text = text or "Button"
- btn.Font = Enum.Font.Gotham
- btn.TextSize = 16
- btn.TextColor3 = Color3.fromRGB(255, 255, 255)
- Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 8)
- btn.MouseEnter:Connect(function()
- TweenService:Create(btn, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(60, 60, 90)}):Play()
- end)
- btn.MouseLeave:Connect(function()
- TweenService:Create(btn, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(40, 40, 60)}):Play()
- end)
- btn.MouseButton1Click:Connect(function()
- TweenService:Create(btn, TweenInfo.new(0.05), {TextSize = 14}):Play()
- task.wait(0.05)
- TweenService:Create(btn, TweenInfo.new(0.1), {TextSize = 16}):Play()
- pcall(callback)
- end)
- end
- return library
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment