Gun doesn't kill players, but kills NPCs.. Why gun doesn't hit players?

Hello!
I have a problem with the gun that is supposed to kill players. But it doesn’t kill players, it only kill NPCs. How to fix it?(The players are in different teams and you can easily kill them with a sword, for example).
Solved.

2 Likes

You could try rereading/removing all the humanoid conditions in your RayCast function. I would think it would be more logical to at least move these checks into the Fire function instead.

Honestly, looking at this script is confusing and a little cramped, but the only thing I see that could be the problem is that some players don’t have a Torso and have a UpperTorso and LowerTorso instead.

I tried to change values ​​in fire function - “UpperTorso” instead of “Torso”, but now I have an error And I don’t even know if it would work.
My error: UpperTorso is not a valid member of Humanoid "Workspace.dan_kulik.Humanoid" - Client - GunScript_Local:107 How do I find UpperTorso? How correctly should it look in script?

Player’s base parts are not parented to Humanoid

1 Like

The torso and upper torso would be parented under the character, not the humanoid.

Is this gun supposed to work with R6, R15, or both?

1 Like

Gun should work on both (R6 and R15).

Anyone have any ideas? Anyone know what could be wrong there?