Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------- // Player And Mouse
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local SamplesToTake = 20
- local TimerInc = 0.05
- local PeriodicResetTime = 60
- -------------------------------------------- // Timer
- local ClickTime = 0
- local KeyTime = 0
- while true do
- wait(TimerInc)
- KeyTime = KeyTime + TimerInc
- ClickTime = ClickTime + TimerInc
- end
- -------------------------------------------- // Anti Key
- local KeyAverage = 0
- local KeySampleCount = 0
- local KeyTotalTime = 0
- Mouse.KeyUp:Connect(function(Key)
- KeySampleCount = KeySampleCount + 1
- KeyTotalTime = KeyTotalTime + KeyTime
- KeyAverage = KeyTotalTime / KeySampleCount
- local TimeHolder = KeyTime
- KeyTime = 0
- if KeySampleCount >= SamplesToTake then
- if TimeHolder == KeyAverage then
- -- Automatic Key Pressing Detected
- end
- KeySampleCount = 0
- KeyTotalTime = 0
- KeyAverage = 0
- end
- end)
- -------------------------------------------- // Anti Click
- local ClickAverage = 0
- local ClickSampleCount
- local ClickTotalTime = 0
- Mouse.Button1Up:Connect(function()
- ClickSampleCount = ClickSampleCount + 1
- ClickTotalTime = ClickTotalTime + ClickTime
- ClickAverage = ClickTotalTime / ClickSampleCount
- local TimeHolder = ClickTime
- ClickTime = 0
- if ClickSampleCount >= SamplesToTake then
- if TimeHolder == ClickAverage then
- -- Automatic Mouse Clicking Detected
- end
- ClickSampleCount = 0
- ClickTotalTime = 0
- ClickAverage = 0
- end
- end)
- -------------------------------------------- // Periodic Reset
- while true do
- wait(PeriodicResetTime)
- ClickSampleCount = 0
- ClickTotalTime = 0
- ClickAverage = 0
- KeySampleCount = 0
- KeyTotalTime = 0
- KeyAverage = 0
- KeyTime = 0
- ClickTime = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement