Could I have some help with a script that automatically kicks someone if their speed changes?
Asked by
6 years ago Edited 6 years ago
So here is the portion of my anti-cheat that has walkspeed
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local Char = Player.Character or Player.CharacterAdded:Wait() |
03 | local Hum = Char:WaitForChild( "Humanoid" ) |
05 | Hum:GetPropertyChangedSignal( "WalkSpeed" ):Connect( function (Speed) |
06 | if (Hum.WalkSpeed > = 51 ) then |
07 | local ban = game.ServerScriptService.AntiSpeed.Ban |
10 | Player.kick(Player.. " your speed is too high! As a result, you were kicked." ) |
I have also tried putting it in a while true do
02 | Hum:GetPropertyChangedSignal( "WalkSpeed" ):Connect( function (Speed) |
03 | if (Hum.WalkSpeed > = 51 ) then |
04 | local ban = game.ServerScriptService.AntiSpeed.Ban |
07 | Player.kick(Player.. " your speed is too high! As a result you were kicked." ) |
If anyone could help that would be highly appreciated. This is in a normal script put in ServerScriptStorage. FE is off.