Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Создаем библиотеку для кнопок
- local ButtonLibrary = {}
- -- Функция для создания кнопки
- function ButtonLibrary:NewButton(text, callback)
- -- Создаем кнопку
- local button = Instance.new("TextButton")
- button.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") -- Помещаем в PlayerGui
- button.Text = text
- button.Size = UDim2.new(0, 400, 0, 50) -- Размер кнопки
- button.Position = UDim2.new(0.5, -200, 0.5, -25) -- Центрируем кнопку
- button.BackgroundColor3 = Color3.fromRGB(170, 0, 255) -- Цвет фона
- button.TextColor3 = Color3.fromRGB(255, 255, 255) -- Цвет текста
- button.TextSize = 20
- button.TextWrapped = true
- -- Применяем закругленные углы
- local UICorner = Instance.new("UICorner")
- UICorner.Parent = button
- -- Обработчик нажатия на кнопку
- button.MouseButton1Click:Connect(callback)
- return button
- end
- return ButtonLibrary
Advertisement
Add Comment
Please, Sign In to add comment