Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago

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

Log in to vote
0
Answered by
Antelear 185
2 years ago

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.

Ad

Answer this question