Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Creating the GUI
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local gui = Instance.new("ScreenGui")
- gui.Name = "SitGUI"
- gui.Parent = player.PlayerGui
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 150)
- frame.Position = UDim2.new(0, 100, 0, 100)
- frame.BackgroundTransparency = 0.5
- frame.BackgroundColor3 = Color3.fromRGB(255, 255, 0) -- Yellow
- frame.Active = true
- frame.Draggable = true
- frame.Parent = gui
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Size = UDim2.new(1, 0, 0, 30)
- titleLabel.Text = "Sit GUI"
- titleLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 0) -- Yellow
- titleLabel.Parent = frame
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 50, 0, 30)
- closeButton.Position = UDim2.new(1, -50, 0, 0)
- closeButton.Text = "X"
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Parent = titleLabel
- local pressToSitButton = Instance.new("TextButton")
- pressToSitButton.Size = UDim2.new(0, 150, 0, 50)
- pressToSitButton.Position = UDim2.new(0.5, -75, 0.5, -25)
- pressToSitButton.Text = "Press to sit!"
- pressToSitButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green
- pressToSitButton.Parent = frame
- -- Handling button click
- pressToSitButton.MouseButton1Click:Connect(function()
- player.Character.Humanoid.Sit = true
- end)
- -- Handling close button click
- closeButton.MouseButton1Click:Connect(function()
- gui:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement