Hello Developers! I need help with detecting if a humanoid belongs to a player or NPC. I need this so that my gun can only attack NPC’s and not Players.
Here is the part of my script which does damage:
local function _defaultDamageCallback(system, target, amount, damageType, dealer, hitInfo, damageData)
if target:IsA("Humanoid") then
target:TakeDamage(amount)
end
end
What edit do I have to make so that it can only attack NPCs?