I thought of this once but what about the rare chance that a player actually clicks a mouse that fast (on accident or on purpose) and gets banned. That would really suck for the innocent player.
So then I could make it “kick” instead of ban when the autoclicker is detected?
A concept I had, never made it an actual thing, would be monitor the rate of clicking over an extended period of time. A human is not capable of clicking perfectly every second. A machine obviously won’t be right on the dot, but you can add a threshold. Clicks should be monitored over a lengthened period of time, not based on clicks-per-second. If you have consistent clicking over the course of 5-10 seconds, it’s pretty safe to assume it’s not a normal person.
Autoclickers can only be detected with the client, and as such, can be bypassed by exploiters. Don’t bother implementing click timing into remotes either due to latency.
You can’t stop an exploiter from bypassing the click timing, but you can stop a normal player from whipping out the classic AutoClicker.exe.
I made a system for it before. Let me try and find it.
I don’t think it’s a good idea to directly kick a player for auto clicking or even clicking fast. Just send to the server that they did that so the game can handle it properly. Maybe even a alert on the client, but direct moderation like kicking is not needed.
Found it here:
Hope this helps you @ValiantWind
Add a script into server script service:
game.Players.PlayerAdded:Connect(function(Player)
local CPS = Instance.new("IntValue", Player)
CPS.Name = "CPS"
end)
next a local script to startergui to add 1 to the cps, and kick them if its 25
local Mouse = game.Players.LocalPlayer:GetMouse()
local CPS = game.Players.LocalPlayer:WaitForChild("CPS")
CPS.Changed:Connect(function()
if CPS.Value == 25 then
game.Players.LocalPlayer:Kick("You have been kicked for auto clicking.")
end
end)
Mouse.Button1Down:Connect(function()
print("e")
CPS.Value = CPS.Value +1
end)
while true do
wait(1)
CPS.Value = 0
end
Much better way to find CPS and it has client sidded kicking. There better ways.
I made this system for some guy a few months ago. It’s just something simple i did.
Make an afk detection system and if the user triggers it make them complete a captcha
Well in cases like these it helps to try and imagine how you would react in that situation. Say you missclick and the autoclick system detects it as an auto and you get kicked. You’re right that getting kicked isnt as bad, but it would still suck if you were in the zone then get kicked for something you didnt do. It would be confusing because you did nothing wrong but the game says “you auto” and might cause players to not return to your game.
However if you mean using an autoclicker to avoid the afk kicking system, im not sure thats possible. Its a game design flaw because you reward time spent in a game instead of players doing stuff like shooting or fighting.
what if a player isnt autoclicking and just happened to click that fast for whatever reason. Could be accidental, hardware malfunction, or even just fast fingers. Getting kicked would suck
Here, I wrote this in visual studio code soooo
local mouse = game.Players.LocalPlayer:GetMouse()
local lastPress = os.clock()
mouse.Button1Down:Connect(function()
local timeDelta = os.clock() - lastPress
print(timeDelta)
local cps = 1 / timeDelta
if cps >= 30 then -- limit number here
print("30 cps")
end
end)
if someone can click at a speed of 25 per second then they’re crazy.
i agree lol, they wouldn’t be human. But hey, gaming shouldn’t be exclusive to humans!
On a serious note, its very very unlikely but hey its definitely possible
Wow! These are great ideas! Thank you so much everyone. I would try them to see if they all work but, as you all know, Roblox is down.
Most autoclickers allow setting the interval manually, so doing as some answers suggest and checking if the player doesn’t click too much per second could’ve easly bypassed by setting the click interval to a bigger number.
I’d save the interval of the clicks, if for example 30 clicks share the exact same perfect interval then it’s most likely not a human. Then rather than kicking (to avoid kicking players by mistake) you can simply add a requirement like moving the character to be able to click again.
Otherwise you could simply make your AFK detection system account only for player movement and not for camera movement/clicks, so regardless of if they click or not they’ll be set AFK.
To detect if someone is AFK the best solution imo is to have an fire an event to the client requesting a response and then if the player clicks the prompt the client fires the server and the request is dropped.
There isn’t really a better method than that.
Yes, there are security issues with that but I am 100% certain it is the best method for detecting afkers. Alternatively you could have some mods in your game look out for robots and ban them.
When it comes to autoclickers you need to create a box and wiskers chart for the time between clicks. If the interquartile range is incredibly small (small deviation within ms) then it is most definitely an autoclicker. It will work for even slower auto click speeds.
In theory you could just check for range however you may run into false positives if the amount of clicks recorded is not large…
To detect a certain amount of clicks you could just make a script that updates every second, which sets a value to 0 and when the player clicks that value increments by 1, so basically:
local clicks = 0
local maxamount = "put your max clicks per second how much you want (as intvalue ofc)"
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
coroutine.wrap(function()
while wait(1)
if clicks >= maxamount then print("Autoclicker has been detected!") end
clicks = 0
end
end)()
mouse.Button1Down:Connect(function()
clicks += 1
end)
BUT
What if the player has an autoclicker that clicks every one second or at a long amount of time? It won’t be detected at all, so what I recommend is to make a script where it checks every second if the player has moved, if not, after an amount of time the player gets clicked for afk. (By the way I don’t know if the script works properly since I can’t test it out due to Roblox’s problems)
EDIT: I wrote “click” instead of “clicks” at line 9
Yes, this script above does detect if the user has a fast auto clicker, but It’s not friendly because it’s in a local script, and then it’s really hard to work around it, I suggest making a Remote Event called “OnClick” (You can name it whatever you want), and then whenever the player clicks it fires the event, and then on the server-side, you just check how much Remotes you got from the person if it didn’t exceed the “maxCPS” then continue with the script normally
Local script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remote = ReplicatedStorage:WaitForChild("OnClick")
local textButton = "....." -- Im assuming you are pressing something, so it might be a text button
textButton.MouseButton1Click:Connect(function()
Remote:FireServer()
end)
Server Script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remote = ReplicatedStorage:WaitForChild("OnClick")
local CPS
local maxCPS = 25 -- Set this to anything you think an autoclicker makes
local playersFiredWhileLoop = {}
Remote.OnServerEvent:Connect(function(player)
if not player.CPS then
CPS = Instance.new("IntValue")
CPS.Name = "CPS"
CPS.Parent = player -- You can set it wherever
CPS.Value = 0
else
if not table.find(playersFiredWhileLoop, player.Name) then
table.insert(playersFiredWhileLoop, player.Name)
coroutine.wrap(function()
while true do
wait(1)
CPS.Value = 0
end
end)()
continue
end
if CPS.Value >= maxCPS then
print(string.format("%s is using an autoclicker!", player.Name))
else
-- Player is not using an autoclicker, and you can proceed with whatever you were doing for example:
player.leaderstats.Coins.Value += 1
end
end
end
end)
Players.PlayerRemoving:Connect(function(player)
if table.find(playersFiredWhileLoop, player.Name) then
table.remove(playersFiredWhileLoop, table.find(playersFiredWhileLoop, player.Name))
end
end)
I wrote this code in 1 shot, so if there are any errors please reply and I will try to help you as much as you can,
If you are confused about some parts feel free to reply as well because it is kinda long for just an auto clicker detection system.
I wouldn’t bother and instead try to design my game so that having an auto clicker isn’t that advantageous. But if you really need to make an autoclicker detector for whatever reason, then I would suggest instead of making a script that detects fast clicks, make a script that can detect very consistent clicks as it is very possible for a human to click as fast as an autoclicker but very unlikely that even for a few seconds it could click as consistently as an autoclicker. While it may be possible to make an autoclicker that emulates inconsistent clicks, most people would use an off the shelf all purpose autoclicker for autoclicking.