Auto Clicker Gamepass

Hi i need help i have a system with a double clicks gamepass i need a auto clicker game pass

3 Likes

You could check on the server( after firing an event when clicking and getting things) if they have a double gamepass, if they do,give them x2 clicks.

About auto clicker,you could check when theyjoin the game and have the auto pass then wrap a while loop in a spawn function and give them clicks every x seconds.

Make a local script under a button, and paste the local script in there. The script goes in ServerScriptService. When you have done that, insert a RemoteEvent into ReplicatedStorage and name it “Autoclicker”. This should create the “autoclicking” effect, and you can adjust the while wait loop’s cooldown to your preference.

You should look into loops, and how to work with them. I’d also recommend reading up on debounce and remotes. I hope this will help you achieve whatever you are trying to make.

Local script

local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Autoclicker = ReplicatedStorage:WaitForChild("Autoclicker")


local button = script.Parent

local active = false
button.MouseButton1Click:Connect(function()
	if not active then 
		active = true
		Autoclicker:FireServer(true)
	elseif active == true then 
		active = false
		Autoclicker:FireServer(false)
	end
end)

Server Script

local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Autoclicker = ReplicatedStorage:WaitForChild("Autoclicker")

local gamepass = 77284602 -- add your id here


local toggle
local debounce = false
Autoclicker.OnServerEvent:Connect(function(client, toggled)
	
	toggle = toggled
	if not debounce then 
		debounce = true
	

		if MarketplaceService:UserOwnsGamePassAsync(client.UserId, gamepass) then
			local leaderstats = client:WaitForChild("leaderstats")
			local Cash = leaderstats:FindFirstChild("Cash")

			while wait(1) do 
				if toggle == false then 
					break
				else 	
					Cash.Value += 1
				end
			end

		end
		task.wait(1)
		debounce = false
	end
	
end)


game.Players.PlayerAdded:Connect(function(client)
	
	local leaderstats = Instance.new("Folder", client)
	leaderstats.Name = "leaderstats"
	
	local cash = Instance.new("NumberValue", leaderstats)
	cash.Name = "Cash"
	
	
end)
2 Likes

I fixed it by not forring the event but do somthing else