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.

6 comments

0

I Think you may just have to define all variables.

0

ok thanks

0

can i do if part.Touched:connect(FirstFloor, SeconedFloor) then

0

No. connect is deprecated, it's Connect. Also, the Touched event passes only the part that touched it, nothing else.

0

And seeing what you want to do, it will error, since you're trying to listen for an event within an if statement.

0

What would be the best way to change the elevators value when it connects to a part with a value