Advertisement
Parallaxox

Click GUI

Apr 7th, 2025 (edited)
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | Help | 0 0
  1. --https://youtu.be/j5h2DvXeHEU
  2.  
  3. local player = game.Players.LocalPlayer
  4. local playerGui = player:WaitForChild("PlayerGui")
  5.  
  6. local screenGui = Instance.new("ScreenGui")
  7. screenGui.Name = "ClickGui"
  8. screenGui.Parent = playerGui
  9.  
  10.  
  11. local clickButton = Instance.new("TextButton")
  12. clickButton.Size = UDim2.new(0.2,0,0.1,0)
  13. clickButton.Position = UDim2.new(0.02,0,0.45,0)
  14. clickButton.BackgroundColor3 = Color3.fromRGB(50,150,255)
  15. clickButton.TextColor3 = Color3.fromRGB(255,255,255)
  16. clickButton.Font = Enum.Font.SourceSansBold
  17. clickButton.TextSize = 24
  18. clickButton.Text = "Click Me"
  19. clickButton.Parent = screenGui
  20.  
  21.  
  22. local countLabel = Instance.new("TextLabel")
  23. countLabel.Size = UDim2.new(0.2,0,0.08,0)
  24. countLabel.Position = UDim2.new(0.02, 0, 0.35, 0)
  25. countLabel.BackgroundColor3 = Color3.fromRGB(0,0,0)
  26. countLabel.TextColor3 = Color3.fromRGB(255,255,255)
  27. countLabel.Font = Enum.Font.SourceSansBold
  28. countLabel.TextSize = 24
  29. countLabel.Text = "Clicks: 0"
  30. countLabel.Parent = screenGui
  31.  
  32. local clickCount = 0
  33.  
  34. local function updateCounter()
  35.     countLabel.Text = "Clicks: ".. clickCount
  36. end
  37.  
  38. clickButton.MouseButton1Click:Connect(function()
  39.     clickCount = clickCount + 1
  40.     updateCounter()
  41. end)
Tags: Click GUI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement