Using the official Roblox weapons system (https://developer.roblox.com/en-us/articles/weapons-kit) I am completely unsure of why exactly the weapons do not damage non-player humanoids, (ex. NPCs) given the fact that it seems at places within the script it has code to do that. It may not, and I might just be confused. Either way, can someone please please help me and show me how to make the weapons in this kit damage normal humanoids? All help is very much appreciated, thank you.
This uses the official Roblox weapon kit, see an example of it all and contained scripts here: https://www.roblox.com/library/3932996124/Pistol
UPDATE: I may have found where it decides that it only wants to attack players, so I will include the place in the WeaponSystems script (not the entire set of scripts for the guns) I'm guessing is the cause.
*Here is where it finds the humanoid, and also gets the player from it. Maybe editing this would allow it to function on all humanoids? I am not sure how I would go about doing that.*
function WeaponsSystem.getHumanoid(part)
while part and part ~= workspace do
if part:IsA("Model") and part.PrimaryPart and part.PrimaryPart.Name == "HumanoidRootPart" then
return part:FindFirstChildOfClass("Humanoid")
end
part = part.Parent
end
end
function WeaponsSystem.getPlayerFromHumanoid(humanoid)
for _, player in ipairs(Players:GetPlayers()) do
if player.Character and humanoid:IsDescendantOf(player.Character) then
return player
end
end
end

3 comments
I edited to a link of one of the official weapons. There are too many scripts to copy so it would probably be easier to just add the pistol to your library and examine from there.
I just tested out the Weapons, and they damaged non-players just fine. Is the problem only occurring in the actual game? Or in studio as well
The issue is in both studio and the game. Would you mind hitting me up on discord? ThatDylan#4243