my touched function will only detect parts inside player:
rocket = Instance.new("Part", workspace)
rocket.Size = Vector3.new(1,1,20)
rocket.Anchored = true
rocket.CanCollide = false
rocket.Position = char.PrimaryPart.Position + char.PrimaryPart.CFrame.LookVector * 10
rocket.CFrame = CFrame.new(rocket.Position, char.PrimaryPart.Position)
rocket.Touched:Connect(function(z)
print(z.Name)
--[[ if z.Name ~= "Torso" then
if z.Name ~= "Head" then
if z.Name ~= "Left Arm" then
if z.Name ~= "Right Arm" then
if z.Name ~= "Right Leg" then
if z.Name ~= "Left Leg" then
if z.Name ~= "HumanoidRootPart" then
rocket:Destroy()
end
end
end
end
end
end
end]]
end)
it still detects the players parts like “humanoidrootpart” and “torso”, my problem is that it wont detect any other parts, like “baseplate” or just any random part laying around
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then return end
-- do your stuff here
end)