Atm my projectile goes through walls. My idea was if not HitPlayer then destroy it, but that ends up destroying it immediately, as it hits an accessory or the tool itself, or whatever. How can I get it to destroy what it’s touched is not a player/child of a player
Projectile.Touched:Connect(function(hit)
local Character = hit.Parent
if not Character then return end
local HitPlayer = Players:GetPlayerFromCharacter(Character)
if not HitPlayer then return end -- Make sure it's an actual player
if HitPlayer == player then return end
PlayerHit:Play()
CharacterHit(Character)
end)