Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://youtu.be/j5h2DvXeHEU
- local player = game.Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "ClickGui"
- screenGui.Parent = playerGui
- local clickButton = Instance.new("TextButton")
- clickButton.Size = UDim2.new(0.2,0,0.1,0)
- clickButton.Position = UDim2.new(0.02,0,0.45,0)
- clickButton.BackgroundColor3 = Color3.fromRGB(50,150,255)
- clickButton.TextColor3 = Color3.fromRGB(255,255,255)
- clickButton.Font = Enum.Font.SourceSansBold
- clickButton.TextSize = 24
- clickButton.Text = "Click Me"
- clickButton.Parent = screenGui
- local countLabel = Instance.new("TextLabel")
- countLabel.Size = UDim2.new(0.2,0,0.08,0)
- countLabel.Position = UDim2.new(0.02, 0, 0.35, 0)
- countLabel.BackgroundColor3 = Color3.fromRGB(0,0,0)
- countLabel.TextColor3 = Color3.fromRGB(255,255,255)
- countLabel.Font = Enum.Font.SourceSansBold
- countLabel.TextSize = 24
- countLabel.Text = "Clicks: 0"
- countLabel.Parent = screenGui
- local clickCount = 0
- local function updateCounter()
- countLabel.Text = "Clicks: ".. clickCount
- end
- clickButton.MouseButton1Click:Connect(function()
- clickCount = clickCount + 1
- updateCounter()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement