Advertisement
FreshGamer430

GarfieldClicker.lua

Jan 23rd, 2025
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. -- Made by FreshGamer723
  2.  
  3.  
  4. local player = game.Players.LocalPlayer
  5. local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  6. screenGui.Name = "AutoClickerGUI"
  7.  
  8. local toggleButton = Instance.new("TextButton")
  9. toggleButton.Size = UDim2.new(0, 200, 0, 50)
  10. toggleButton.Position = UDim2.new(0.5, -100, 0.9, -25)
  11. toggleButton.Text = "Toggle Auto-Clicker: OFF"
  12. toggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  13. toggleButton.Parent = screenGui
  14.  
  15.  
  16. local isAutoClickEnabled = false
  17. local replicatedStorage = game:GetService("ReplicatedStorage")
  18. local clickEvent = replicatedStorage:WaitForChild("Events"):WaitForChild("GarfieldClicked")
  19.  
  20.  
  21. local function toggleAutoClick()
  22. isAutoClickEnabled = not isAutoClickEnabled
  23. toggleButton.Text = "Toggle Auto-Clicker: " .. (isAutoClickEnabled and "ON" or "OFF")
  24. toggleButton.BackgroundColor3 = isAutoClickEnabled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  25.  
  26. if isAutoClickEnabled then
  27. -- Start the auto-click loop
  28. spawn(function()
  29. while isAutoClickEnabled do
  30. wait() -- Adjust wait time if needed
  31. clickEvent:FireServer()
  32. end
  33. end)
  34. end
  35. end
  36.  
  37.  
  38. toggleButton.MouseButton1Click:Connect(toggleAutoClick)
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement