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