I am trying to make my game kick any players that speed hack. If you're wondering what the number 44 is for, it's because I've already added a shift to sprint system to the game and that's the sprinting speed. But the problem with the script below is that whenever I enter the game, it kicks me the second I enter.
local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer repeat wait() until LocalPlayer.Character while true do wait() if LocalPlayer.Character.Humanoid.WalkSpeed ~= 0 or 16 or 44 then LocalPlayer:Kick("Exploiting") wait(10) end end
I assume you want the player(s) to move at those speeds? If so try this:
local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer repeat wait() until LocalPlayer.Character while true do wait() local WS = LocalPlayer.Character.Humanoid.WalkSpeed --if LocalPlayer.Character.Humanoid.WalkSpeed ~= 0 or 16 or 44 then <<-- this won't work and will allways return true due to 16 and 44 are non null numbers! if WS~= 0 and WS ~= 16 and WS ~= 44 then LocalPlayer:Kick("Exploiting [Walkspeed!]") wait(10) end end