Is this anticheat exploitable?

--Client sided
local Character = script.Parent.Parent
local Player = game.Players.LocalPlayer
local PP = Character.PrimaryPart

local Lastpos
local Violations = 0

script.Destroying:Connect(function() --Kicks if deleted while alive
	if Character:FindFirstChild("Humanoid") and Character:FindFirstChild("Humanoid").Health > 0 then
		game.Players:GetPlayerFromCharacter(Character):Kick("Attempted to delete anti-cheat")
	end
end)

script:GetPropertyChangedSignal("Disabled"):Connect(function() --Kicks if disabled
	if script.Disabled then
		local P = game.Players:GetPlayerFromCharacter(Character)
		P:Kick("Attempted to disable anti-cheat")
	end
end)

local DB = false
game:GetService("RunService").Heartbeat:Connect(function()
	if Lastpos ~= nil then
		if (Lastpos-PP.Position).Magnitude > 40 and Character:WaitForChild("Humanoid").Health > 0 and PP.Velocity.Magnitude <= 50 then
			local Player = game.Players:GetPlayerFromCharacter(Character)
			task.wait(1.1)
			if not Player:FindFirstChild("Menu") and not Character:WaitForChild("Humanoid"):FindFirstChild("RagdollTag") then
				Player:Kick("Anti-cheat: Teleport")
			end
		elseif (Lastpos-PP.Position).Magnitude > 20 and (Lastpos-PP.Position).Magnitude <= 40 and Character:WaitForChild("Humanoid").Health > 0 and PP.Velocity.Magnitude <= 50 then
			local Player = game.Players:GetPlayerFromCharacter(Character)
			task.wait(1.1)
			if not Player:FindFirstChild("Menu") and not Character:WaitForChild("Humanoid"):FindFirstChild("RagdollTag") and Violations > 2 then
				Player:Kick("Anti-cheat: Teleport")
			elseif Violations <= 2 and not DB then
				DB = true
				Violations += 1
				task.wait(0.25)
				DB = false
			end
		end
	end
	Lastpos = PP.Position
end)

Character.DescendantAdded:Connect(function(Child) --Sends the event to server to check
	if Child:IsA("BodyVelocity") and Child.Name ~= "KB_VL_TG" then
		script.Parent:WaitForChild("Server"):FindFirstChild("Check"):InvokeServer(Child)
	end
end)

while task.wait(1) do
	if Character:WaitForChild("Humanoid") and Character:WaitForChild("Humanoid").WalkSpeed > 35 or Character:WaitForChild("Humanoid").JumpPower > 60 then
		game.Players:GetPlayerFromCharacter(Character):Kick("Anti-cheat: Speed/Jump")
	end
end
--Server sided
local Check = script:WaitForChild("Check")
function Check.OnServerInvoke(Player,Velocity)
	if not Velocity then --This checks if the item exists in Server, if not, the client added it
		Player:Kick("Anti-cheat: Fly")
	end
end
2 Likes

A general rule of thumb is that any client script that isn’t environment hidden and/or have tamper protection will be bypassable. However, even with these 2 protections, it’s still possible (although very very small) for the average exploiter to tamper with it.

4 Likes

It’s very exploitable, if you are a beginner I recommend you start with full server-sided anti-cheats and once you are confident enough in those start to try and make client-sided anti-cheats that complement the server anti-cheat. Here are some free server sided anti cheat resources scattered around: Framework, Octagon and Anti Teleport. You should also check out RejectCharacterDeletions which stops exploiters from tampering with their character.

3 Likes

Pretty sure my anticheat handles most of those items.
-Checks for bodyvelocities on client (fly)
-Checks distance moved per frame (teleport)
Also stops exploiters from deleting or disabling the script
In the case the character gets the deleted, I’m pretty sure it’ll trigger the script deletion (May add that if it doesn’t trigger)
And noclip isn’t a huge issue since the most you can do is scare someone and then get exploded by a missile.
Thanks for the feedback though!

It’d be helpful too if you could tell me how it’s exploitable*

1 Like

Your anticheat is mostly on the client; An exploiter can just disable the event connections and make the property values on Instances return false values

2 Likes