Does this line of code saves touchinterest from exploiters?

So basically i want to prevent exploiters from activating, aka “Healing” themselves in any position on the map

And i don’t know if this will help:

-- / VARIABLES /
local MainPart = script.Parent.Parent

-- / VARIABLES /
MainPart.Touched:Connect(function(Hit)
	local DistanceCheck = (MainPart.Position - Hit.Position).Magnitude
	if DistanceCheck < 5 then
		warn("Verified the distance!")
	else
		warn("Didn't verify the distance, possible exploiter")
	end
end)

Yes, in theory, but no. Exploiters can simply teleport to the part if they really wanted to get healed. Yes, they can’t activate the touch interest from a long distance to heal, but they can teleport there and back to get the healing.

It seems good, just make sure it’s a server-script. Also what @Kaid3n22 said, exploiters can teleport themselves to the health pack.

don’t worry i have a control of the teleport exploits, etc…
anyways, thanks for the replie!

it is server-sided, thanks for the reply!

Make sure you’re verifying where the player should be. Just checking if a player has teleported isn’t good enough as they’ll interact with the touch part faster than that.

1 Like

I believe exploiters could still fire the touchinterest event before they get sent back by the anticheat?

1 Like

sounds like a problem, ill test it right now

It seems it doesn’t validate the touch, so i guess that’s not a problem