Feedback on anti-speed exploit script

Would this be a viable idea for an anti-speed exploit script?

while task.wait(0.25) do
for _, player in pairs(Players:GetPlayers()) do
local character = player.Character

	if not character then
		continue
	end
	
	local speed = math.floor((character.PrimaryPart.AssemblyLinearVelocity * 
            Vector3.new(1, 0, 1)).Magnitude)
	
	if speed > character.Humanoid.WalkSpeed then
		print("Exploit!")
	end
end

end

10 Likes

not really, it’d be impossible to differentiate whether it was an extreme case or an exploit. But obviously extra checks can be added to ensure there are less false positives.

2 Likes

Could you give me an example of these extreme cases?

2 Likes

ingame bugs which may lead to unintended speed increases or flinging

3 Likes

Ah okay thanks for your feedback!

2 Likes

Since they’re the network owner, they can lie about their velocity, so no.

2 Likes

I tested this by updating my character’s velocity to be below the max walkspeed on the client and the anti exploit still detected when I went above the max speed?

1 Like

Yes, but what if they anchor their character on the client and move it?

2 Likes

Like a teleport exploit? character limit

Yes. It shouldn’t change the velocity, should it?

2 Likes

Oh you’re right I tested it just now! but this isn’t really an anti-exploit for teleportation. Thanks for the feedback by the way I didn’t know anchored parts had no velocity

Yeah, you’d need to compare their position from the last time you checked to make anti teleport.

1 Like

You should check positions of the rootpart before and after the timer. Then compare those positions and divide the distance by time to get the speed.

Make sure you have a large enough error margin, so laggy players don’t get teleported back all the time.

I’ve made a detection exploit that threw the exploiter in a tween loop that would make everyone watch it then make the exploiter dissolve like being snapped out of existence, then would throw them into a portal and kick them