Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to use a Touched event in an if statement?

Hi. I've researched about this problem on the devforum, but it seems the answers are only for humanoid parts.

How do I do this for a part touching another part?

For example, you roll a ball, and when that ball touches a certain part, it opens a door. How do you do that in an if statement?

Thanks.

1 answer

✓ Accepted answer

Just give the door a .Touched event or the ball a .Touched event, and check if the part that was touched is a basepart and/or the name is the exact name you want to run your code for.

Not sure what you're doing, but this is the only thing I could think of.

This discussion is preserved as it was. New answers, comments, and votes are closed.