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

I'm trying to make an anti-speed exploit script but it's not working with this script?

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

1 answer

✓ Accepted answer

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

3 comments

0

I see the problem thank you!

0

no worries! :)

0

why are you checking that on the client

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