Kotyara19k-Official

Untitled

Apr 4th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. -- Создаем библиотеку
  2. local libraryHub = {}
  3.  
  4. -- Функция для создания кнопки с меню
  5. function libraryHub:NewButton(buttonName, callback)
  6. -- Создаем контейнер для меню
  7. local menu = Instance.new("ScreenGui")
  8. menu.Name = "LibraryMenu"
  9. menu.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  10. menu.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  11. menu.ResetOnSpawn = false
  12.  
  13. -- Создаем фрейм для кнопок
  14. local frame = Instance.new("Frame")
  15. frame.Parent = menu
  16. frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  17. frame.Size = UDim2.new(0, 451, 0, 534)
  18. frame.Position = UDim2.new(0.5, -225, 0.5, -267)
  19.  
  20. -- Применяем градиент для фона
  21. local UIGradient = Instance.new("UIGradient")
  22. UIGradient.Color = ColorSequence.new{
  23. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(137, 0, 254)),
  24. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(223, 0, 255))
  25. }
  26. UIGradient.Parent = frame
  27.  
  28. -- Закругляем углы у фрейма
  29. local UICorner = Instance.new("UICorner")
  30. UICorner.Parent = frame
  31.  
  32. -- Добавляем заголовок
  33. local title = Instance.new("TextLabel")
  34. title.Parent = frame
  35. title.Text = "LibraryHub"
  36. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  37. title.TextSize = 24
  38. title.TextScaled = true
  39. title.Size = UDim2.new(1, 0, 0, 50)
  40. title.BackgroundTransparency = 1
  41.  
  42. -- Создаем кнопку
  43. local button = Instance.new("TextButton")
  44. button.Name = buttonName
  45. button.Parent = frame
  46. button.Text = buttonName
  47. button.Size = UDim2.new(0, 419, 0, 36)
  48. button.Position = UDim2.new(0.5, -209, 0, 75)
  49. button.BackgroundColor3 = Color3.fromRGB(170, 0, 255)
  50. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  51. button.TextSize = 20
  52. button.TextXAlignment = Enum.TextXAlignment.Left
  53. button.Font = Enum.Font.SourceSansBold
  54.  
  55. -- Закругляем углы у кнопки
  56. local UICornerButton = Instance.new("UICorner")
  57. UICornerButton.Parent = button
  58.  
  59. -- Обработчик нажатия на кнопку
  60. button.MouseButton1Click:Connect(function()
  61. callback()
  62. end)
  63.  
  64. return button
  65. end
  66.  
  67. return libraryHub
  68.  
Advertisement
Add Comment
Please, Sign In to add comment