How to make it so it will only print if the part name is "Part2"

I want it to print only when it touches a specific part

I cant seem to find out how

I have tried searching for a solution but to no avail

script.Parent.Touched:Connect(function()
	print("Part2 Has Been Touched!")
end)
1 Like

Is this what are You looking for?

script.Parent.Touched:Connect(function(hit)
	if hit.Name == "Part2" then
		print("Part2 Has Been Touched!")
	end
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.