Hi there, this is my 1st time here. So anyways, I've recently been trying to update signalling for my train game on ROBLOX, which is operated by touch scripts. I'm trying to make it so that it only detects certain parts so that it won't detect one's avatar or some other object. The only problem I have is that I'm pretty new to coding so it's difficult for me to figure out how to do that. I've tried the following codes from the DevForum when someone asked the same question as me:
part.Touched:Connect(function(other) print("Touched By:", other.Name) if other.Name == "SomePartName" then -- code end end)
and
script.Parent.Touched:Connect(function(hit) if hit.Parent.Name = “your name” then –put stuff here end end)
None of those worked for me, and I can't post it myself on the DevForum, so I had to come here. Do you folks have any good tips on how I can update it for it to do that?