Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Создаем библиотеку
- local libraryHub = {}
- -- Функция для создания кнопки с меню
- function libraryHub:NewButton(buttonName, callback)
- -- Создаем контейнер для меню
- local menu = Instance.new("ScreenGui")
- menu.Name = "LibraryMenu"
- menu.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- menu.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- menu.ResetOnSpawn = false
- -- Создаем фрейм для кнопок
- local frame = Instance.new("Frame")
- frame.Parent = menu
- frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- frame.Size = UDim2.new(0, 451, 0, 534)
- frame.Position = UDim2.new(0.5, -225, 0.5, -267)
- -- Применяем градиент для фона
- 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 = frame
- -- Закругляем углы у фрейма
- local UICorner = Instance.new("UICorner")
- UICorner.Parent = frame
- -- Добавляем заголовок
- local title = Instance.new("TextLabel")
- title.Parent = frame
- 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 = frame
- 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)
- return button
- end
- return libraryHub
Advertisement
Add Comment
Please, Sign In to add comment