How to make click per sec Count?

The question is, how can I make the same click rate so that I click and it shows how many clicks I make per second?

I made this script for you, if you have any questions dont hesitate to reply me

local Text = script.Parent--Change it to your text
local LocalPlayer = game.Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local startTime = 0
local clicks = 0

Mouse.Button1Down:Connect(function()
	if startTime == 0 then
		startTime = tick()
		clicks = 0
	else
		local currentTime = tick()
		local timeElapsed = currentTime - startTime
		if timeElapsed > 0 then
			local cps = clicks / timeElapsed
			Text.Text = "Clicks per Second: " .. string.format("%.2f", cps)
		end
		startTime = currentTime
		clicks = 0
	end
	clicks = clicks + 1
end)

--Note: this Script only works on the client (ex: a Playergui) becuase its a local Script
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.