Touched event ignoring player

When making a let’s say projectiled bolt and you want it to ignore your character so even if u’re facing the opposite direction of the target and it passes through u it shouldnt do anything instead if it hits anything but you it will do something, Ik it’s a simple code but it sounds complicated

	Bolt.Touched:Connect(function(Hit)
		print(Hit.Name)
		if Hit.Parent:FindFirstChildWhichIsA("Humanoid") then
			Target = Hit.Parent:FindFirstChildWhichIsA("Humanoid").Parent
		end
		if Hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid") then
			Target = Hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid").Parent
		end
		if Target.Name ~= Plr.Name then
			print(Target.Name)
		end
	end)

I got this code but it doesn’t detect parts/baseplate cause they don’t have lots of parents

1 Like

So, just to clarify, you’re saying that if the bolt hits anything that’s not my character, it will either try to damage it if it’s another character or do something else (like explode) if it’s not, right?