Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Создаем библиотеку
- local libraryHub = {}
- -- Функция для создания кнопки с меню
- function libraryHub:NewButton(buttonName, callback)
- -- Создаем GUI для кнопок
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "LibraryMenu"
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- screenGui.ResetOnSpawn = false
- -- Фрейм для меню
- local menuFrame = Instance.new("Frame")
- menuFrame.Parent = screenGui
- menuFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- menuFrame.Size = UDim2.new(0, 450, 0, 400)
- menuFrame.Position = UDim2.new(0.5, -225, 0.5, -200)
- -- Градиент для фона меню
- local UIGradient = Instance.new("UIGradient")
- UIGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0.00, Color3.fromRGB(137, 0, 254)),
- ColorSequenceKeypoint.new(1.00, Color3.fromRGB(223, 0, 255))
- }
- UIGradient.Parent = menuFrame
- -- Закругляем углы у фрейма
- local UICorner = Instance.new("UICorner")
- UICorner.Parent = menuFrame
- -- Добавляем заголовок
- local title = Instance.new("TextLabel")
- title.Parent = menuFrame
- title.Text = "LibraryHub"
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.TextSize = 24
- title.TextScaled = true
- title.Size = UDim2.new(1, 0, 0, 50)
- title.BackgroundTransparency = 1
- -- Кнопка
- local button = Instance.new("TextButton")
- button.Name = buttonName
- button.Parent = menuFrame
- button.Text = buttonName
- button.Size = UDim2.new(0, 419, 0, 36)
- button.Position = UDim2.new(0.5, -209, 0, 75)
- button.BackgroundColor3 = Color3.fromRGB(170, 0, 255)
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.TextSize = 20
- button.TextXAlignment = Enum.TextXAlignment.Left
- button.Font = Enum.Font.SourceSansBold
- -- Закругляем углы у кнопки
- local UICornerButton = Instance.new("UICorner")
- UICornerButton.Parent = button
- -- Обработчик нажатия на кнопку
- button.MouseButton1Click:Connect(function()
- callback()
- end)
- end
- return libraryHub
Advertisement
Add Comment
Please, Sign In to add comment