Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My Anti AutoClicker script isn't working, what's wrong with it?

I have a script that whenever someone clicks more than 10 times in 0.2 seconds then they get kicked. I'm not sure what I'm doing wrong but I test an autoclicker so it clicks a TextButton to give me points at a very fast speed. My autoclicker is quite agressive but my script isn't kicking me. What is wrong with it?

local maximumLegitClickTime = .20
local successiveClicksBeforeKick = 10

local UIS = game:service"UserInputService"
local player = game.Players.LocalPlayer

local a = 0
local lastClick = 0

local timeSinceLastClick = function(click)
	return click-lastClick
end

UIS.InputBegan:connect(function(input, processed)
	if not processed then
		if input.UserInputType == Enum.UserInputType.MouseButton1 then
			local tSLC = timeSinceLastClick(tick())
			lastClick = tick()
--			print(tSLC)
			if tSLC < maximumLegitClickTime then
				a = a + 1
			else
				a = 0
			end
			if a > successiveClicksBeforeKick then
				player:Kick("Do not exploit to give yourself an unfair advantange | Type: Auto clicker | Contact devs if you believe this is a mistake.")
			end
		end
	end
end)

1 answer

The 'processed' parameter is true when you click on a UI element, not false.

1 comment

0

I've noticed that, regardless it still doesn't work

This discussion is preserved as it was. New answers, comments, and votes are closed.