(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
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
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.