local MaximumClicksPerSecond = 15
local KickMessage = ""
local PrintClicksPerSecond = false
local Player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local Clicks = 0
local function onInputBegan(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
Clicks += 1
end
end
UserInputService.InputBegan:Connect(onInputBegan)
while wait(1) do
if PrintClicksPerSecond then print("CPS: "..Clicks) end
if Clicks >= MaximumClicksPerSecond then
Player:Kick(KickMessage)
end
Clicks = 0
end
That works but It’s only really useful depending on what u need it for, if it’s a grindy game someone autoclicking 14 cps for days straight would bypass that, if the game is about clicking as fast as possible then people who can legitimately click 15+ cps won’t have a good time
I know this script is not perfect but this is what I use when I decide to detect auto clickers.
local time1 = 0
local time2 = 0
local sus = 0
userinputservice.InputBegan:Connect(function(input, gameProcessedEvent)
local inputType = input.UserInputType
if inputType == Enum.UserInputType.MouseButton1 then
if gameProcessedEvent ~= true then
print(time1,time2,sus)
if time1 == time2 then
time2 = time1
time1 = 0
sus += 1
else
time2 = time1
time1 = 0
if sus > 0 then
sus -= 1
end
end
end
end
end)
while true do
wait(.1)
time1 += .1
if sus >= 30 then
game.Players.LocalPlayer:Kick("hi")
end
end