Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UTG = {}
- function UTG:CreateGui()
- local player = game.Players.LocalPlayer
- local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
- gui.Name = "UTGMenu"
- gui.ResetOnSpawn = false
- local main = Instance.new("Frame", gui)
- main.Name = "Main"
- main.Size = UDim2.new(0, 300, 0, 40)
- main.Position = UDim2.new(0, 20, 0.3, 0)
- main.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- main.Active = true
- main.Draggable = true
- local uiCorner = Instance.new("UICorner", main)
- uiCorner.CornerRadius = UDim.new(0, 4)
- local title = Instance.new("TextLabel", main)
- title.Name = "Title"
- title.Size = UDim2.new(1, 0, 1, 0)
- title.BackgroundTransparency = 1
- title.Text = "Ultimate Trolling GUI"
- title.Font = Enum.Font.Code
- title.TextColor3 = Color3.fromRGB(255, 0, 0)
- title.TextScaled = true
- local buttonHolder = Instance.new("Frame", gui)
- buttonHolder.Name = "Buttons"
- buttonHolder.Size = UDim2.new(0, 300, 0, 0)
- buttonHolder.Position = main.Position + UDim2.new(0, 0, 0, 45)
- buttonHolder.BackgroundTransparency = 1
- local layout = Instance.new("UIListLayout", buttonHolder)
- layout.SortOrder = Enum.SortOrder.LayoutOrder
- layout.Padding = UDim.new(0, 5)
- return {
- AddButton = function(_, text, callback)
- local btn = Instance.new("TextButton", buttonHolder)
- btn.Size = UDim2.new(1, 0, 0, 40)
- btn.BackgroundColor3 = Color3.fromRGB(30, 0, 0)
- btn.Text = text
- btn.TextColor3 = Color3.fromRGB(255, 0, 0)
- btn.Font = Enum.Font.Code
- btn.TextScaled = true
- local corner = Instance.new("UICorner", btn)
- corner.CornerRadius = UDim.new(0, 4)
- local stroke = Instance.new("UIStroke", btn)
- stroke.Color = Color3.fromRGB(255, 0, 0)
- stroke.Thickness = 1
- btn.MouseButton1Click:Connect(callback)
- -- Обновим размер фрейма
- buttonHolder.Size = UDim2.new(0, 300, 0, layout.AbsoluteContentSize.Y)
- layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- buttonHolder.Size = UDim2.new(0, 300, 0, layout.AbsoluteContentSize.Y)
- end)
- end
- }
- end
- return UTG
Advertisement
Add Comment
Please, Sign In to add comment