Hitbox script only damages attacker's humanoid

Problem is the same as the topic. I know why the attacker’s humanoid is being damaged, but I just don’t know how to damage the target’s humanoid instead. This snippet is from the server script, the local script works just fine and the hitboxes are defined/hits detected there.

How would I rewrite this to damage the target humanoid without using a :Touched event? For reference, I’m using the RaycastHitboxV4 module for hit detection.

Are you sending the humanoid correctly?

If not:

instadeath.FireServer(Hit,Target.Humanoid)
-- Target being the the person to take damage

The player is automatically sent.

1 Like
local humanoid = character:WaitForChild('Humanoid')

you reassigned it, causing it to become the player’s humanoid.

2 Likes

That’s exactly what I was looking for - I didn’t know how to communicate the detected humanoid from the local script to the server script. I adjusted the server script a tiny bit to stop detecting the attacker’s humanoid as well and now it works just fine. Thanks!

1 Like

Yep, I was aware of that, but I was just so confused on how I’d detect the target (which comes from the local script) so that was somewhat of a placeholder or something to build off of later. Fixed it now thanks to @deadwalker601’s comment

2 Likes

If you still need to use the attackers humanoid, you can just give it a new name like Humanoid or Attacker

1 Like