Kotyara19k-Official

Untitled

Apr 4th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. -- ModuleScript в ReplicatedStorage (назовём "UTGGuiLibrary")
  2.  
  3. local UTG = {}
  4.  
  5. function UTG:CreateWindow(config)
  6. local player = game.Players.LocalPlayer
  7. local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  8. gui.Name = config.Name or "UTGWindow"
  9. gui.ResetOnSpawn = false
  10.  
  11. local frame = Instance.new("Frame", gui)
  12. frame.Size = UDim2.new(0, 450, 0, 300)
  13. frame.Position = UDim2.new(0.5, -225, 0.5, -150)
  14. frame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
  15. frame.BackgroundTransparency = 0.2
  16. frame.AnchorPoint = Vector2.new(0.5, 0.5)
  17.  
  18. local corner = Instance.new("UICorner", frame)
  19. corner.CornerRadius = UDim.new(0, 12)
  20.  
  21. local stroke = Instance.new("UIStroke", frame)
  22. stroke.Color = config.Color or Color3.fromRGB(255, 0, 0)
  23. stroke.Thickness = 2
  24.  
  25. local title = Instance.new("TextLabel", frame)
  26. title.Size = UDim2.new(1, 0, 0, 40)
  27. title.Text = config.Title or "UTG Custom GUI"
  28. title.TextColor3 = stroke.Color
  29. title.BackgroundTransparency = 1
  30. title.TextScaled = true
  31. title.Font = Enum.Font.Code
  32.  
  33. -- Вернём объект с методами
  34. return {
  35. AddButton = function(self, text, callback)
  36. local button = Instance.new("TextButton", frame)
  37. button.Size = UDim2.new(0.8, 0, 0, 40)
  38. button.Position = UDim2.new(0.1, 0, 0, #frame:GetChildren() * 45)
  39. button.Text = text
  40. button.BackgroundColor3 = Color3.fromRGB(30, 0, 0)
  41. button.TextColor3 = stroke.Color
  42. button.TextScaled = true
  43. button.Font = Enum.Font.Code
  44.  
  45. local btnCorner = Instance.new("UICorner", button)
  46. btnCorner.CornerRadius = UDim.new(0, 6)
  47.  
  48. local btnStroke = Instance.new("UIStroke", button)
  49. btnStroke.Color = stroke.Color
  50. btnStroke.Transparency = 0.4
  51. btnStroke.Thickness = 1.5
  52.  
  53. button.MouseButton1Click:Connect(callback)
  54. end
  55. }
  56. end
  57.  
  58. return UTG
  59.  
Advertisement
Add Comment
Please, Sign In to add comment