Handling hitboxes

(re-wrote the post cuz i didn’t express myself right)

ok soo i got a red hitbox that appears infront of the character when they punch

image

i want to know the best way to handle the touch detection of that hitbox like rogue lineage does without exploiters ruining it, i just want a secure hitbox detection, ive see multiple posts talking about how methods like region3 are good but costly and NEVER to use touched or gettouchingparts and to use raycasting but i dont want to use raycasting i want a real hit-box

1 Like

To my knowledge the options you listed are the only ways to detect a player

You can use pairs to get their humanoidrootpart, check if they have a humanoid, etc.
Example:

for i, Enemy in pairs(workspace:GetChildren()) do
	if Enemy ~= Player'sCharacter and Enemy:FindFirstChild("HumanoidRootPart") and Enemy:FindFirstChild("Humanoid") and (HitboxPart.Position - Enemy.HumanoidRootPart.Position).Magnitude <= 2 then
		-- Trigger stuff
	end	
end

Haven’t tested the code, so you might have to improve it.

1 Like

ive expressed myself badly, imma edit the post

I had friends use Magnitude for hitboxes and they seemed to work fine.

i guess magnitude would make exploiters not able to tp their hitbox too far but it would still let things like kill aura exist