is there a way to have a moving part look for a part and get a value from that part. so like an elevator you have x floors first floor it has a detector with a value of 1 for first floor then seconded floor with a detector value of 2. I don't want to define all the detectors in the game I want it when the elevator stops it searches for a part name detector then it finds the value and gets the value to say its on floor 2.
COMMUNITY QUESTION
How to find a part when a part is connected?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
I Think you may just have to define all variables.
ok thanks
can i do if part.Touched:connect(FirstFloor, SeconedFloor) then
No. connect is deprecated, it's Connect. Also, the Touched event passes only the part that touched it, nothing else.
And seeing what you want to do, it will error, since you're trying to listen for an event within an if statement.
What would be the best way to change the elevators value when it connects to a part with a value