Will exploiters bypass this anti speed/tp

I have created an anti tp and anti speed which I am satisfied with but I was wondering if exploiters would be able to bypass it. It serversided but is there a way to trick the server in to thinking otherwise like if I need to check the players states.

Code:

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local MaxSpeed = 16
local PlayerAddedFunction = function(Player)
	local CharacterAddedFunction = function(Character)
		local PrimaryPart = Character.PrimaryPart or Character:GetPropertyChangedSignal("PrimaryPart"):Wait()
		PrimaryPart = PrimaryPart or Character.PrimaryPart

		task.wait(1)
		local FormerPosition = nil
		while true do
			if FormerPosition then
				local DeltaPosition = PrimaryPart.Position - FormerPosition
				if math.floor(math.abs(DeltaPosition.X)) > MaxSpeed or math.floor(math.abs(DeltaPosition.Z)) > MaxSpeed then
					Player:Kick("We're sorry, genuinely.")
				end
			end
			FormerPosition = PrimaryPart.Position
			task.wait(1)
		end
		return
	end
	Player.CharacterAdded:Connect(CharacterAddedFunction)
	return
end

local Initialize = function()
	Players.PlayerAdded:Connect(PlayerAddedFunction)
	return
end
Initialize()
3 Likes

It’s serversided so not bypassable.

About the states, if I check if the player was running the exploiter could force the servers hand by making the player hover above the ground putting the State in freefall

I see two weaknesses here

  1. When someone falls or so, could they not exceed the limit?
  2. If you check once per second, the exploiter can teleport somewhere quickly, make something happen, and teleport back again

Other than that, I think you just need to pay attention not to make it too sensitive, after that you’ll be in the safe zone!

1 Like

1.) No, since it only checks on the X and Z axis falling will not affect anything.

2.) If I check to regularly (t < .1) then I lose on accuracy meaning it will detect only detect high changes. For example the maxspeed is 16 if I set the check intervals to .05 then it will detect player whoms velocity is 20 >

I think thats it.

1 Like

I did think of that and setting t to .1 seems to work best

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local d = 16
local t = 1 / 10
local PlayerAddedFunction = function(Player)
	local CharacterAddedFunction = function(Character)
		local PrimaryPart = Character.PrimaryPart or Character:GetPropertyChangedSignal("PrimaryPart"):Wait()
		PrimaryPart = PrimaryPart or Character.PrimaryPart

		task.wait(t)
		local FormerPosition = nil
		while true do
			if FormerPosition then
				local DeltaPosition = PrimaryPart.Position - FormerPosition
				if math.floor(math.abs(DeltaPosition.X)) > d * t or math.floor(math.abs(DeltaPosition.Z)) > d * t then
					Player:Kick("We're sorry, genuinely.")
				end
			end
			FormerPosition = PrimaryPart.Position
			task.wait(t)
		end
		return
	end
	Player.CharacterAdded:Connect(CharacterAddedFunction)
	return
end

local Initialize = function()
	Players.PlayerAdded:Connect(PlayerAddedFunction)
	return
end
Initialize()

I understand the point you’re making, but I still think its better to work with this

Players velocitites will not change if they teleport, and that can be easily bypassed by making a custom movement system by making incremental teleports with 1 second magnitude of 16 or more

Just spent like 30 minutes testing it out, and it is definitely exploit-proof. I tried tampering with the Character’s PrimaryPart, Humanoid, and the HumanoidRootPart as well as made scripts to bypass, but none of them worked.

Also, another thing I noticed is that it does fire off false positives when you’re on a conveyor or a moving platform, so might wanna fix that depending on what type of game you’re doing.

Not 100% sure but they can just delete and replace their HumanoidRootPart. Try and focus on the players Head

They cannot remove their head, Without dying. At least this is what I was told by several others. :+1:

What about slow connections? Maybe instead of only measuring distance travelled, you could track distance travelled over time?

I.e. by using GetPropertyChangedSignal on the position, and storing the time the last movement occurred as well as the former position

I tried that and set the character’s PrimaryPart to some part in workspace which had all of the HumanoidRootPart’s children, then I set the LowerTorso’s root constraint to that Part and didn’t die.

But even still, as long as the PrimaryPart is unchanged on the server, it is un-bypassable as far as I know.