Flying Exploit Detection

Knowing this, you could check the Velocity or RotVelocity in the case where it gets dangerously (as in flying) high. You can check this on the server too without having to worry about bypassing your client side anticheat.

The issue with this, is if a player is flung (roblox glitch) there would be no way of knowing if this happens.

Example

--Example
HumanoidRootPart:GetPropertyChangedSignal("Velocity"):Connect(function()
if HumanoidRootPart.Velocity.Magnitude > 1000 then -- i don't think you can compare vectors normally, this is easier than making a function for this
Player:Kick("You MIGHT be exploiting")
end
end)

Client Side

On the contrary, you can go the client sided route:

-- Client-sided example
Character.DescendantAdded:Connect(function(Object)
if Object:IsA("BodyMover") then Player:Kick("Exploiting") end -- this is the safest route
end)

Yep, in my anticheats I tend to do a lot of physics checks since they are pretty straight forward to implement.

I do something very similar to this before all of my other checks:

local limit = 2 -- How much faster they can travel from their actual velocity (helps reduce rubber banding for laggy players without giving too much freedom)
-- Lag can cause their velocity to increase (I think its related to throttling but I'm not 100% sure)
-- When you lag physics is slowed down on the client (excluding characters, however this occasionally seems to weirdly have an effect on their root part's velocity, but I'm not sure why this would be the case)

-- Horizontal checks
local horizMask = Vector3.new(1, 0, 1)
velocity = (HumanoidRootPart.Velocity*horizMask) -- Store their horizontal velocity
if (HumanoidRootPart.Velocity*horizMask).Magnitude > Humanoid.WalkSpeed + limit then
	velocity = (HumanoidRootPart.Velocity*horizMask).Unit * (Humanoid.WalkSpeed + limit) -- Clamp their horizontal speed to their current walk speed
end

-- Vertical clamp
velocity = velocity + Vector3.new(0, math.min(HumanoidRootPart.Velocity.Y, Humanoid.JumpPower + limit), 0) -- Clamp their positive vertical velocity to their JumpPower

-- Gravity checks, TP checks, fly checks, etc

It’s also important to make sure you account for vehicles in your game if you have them since the player can then travel much faster. That’s possible to do with Humanoid.SeatPart (and with Attributes now available you can make this process very easy without any extra scripts).

4 Likes