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

How do I make a sensor switch that detects variables?

How do I script a switch that recognizes a variable? To understand the whole thing I explain you what I want to achieve with this script.

Explanation: If a line has the variable 2313 and drives over the switch, a sensor should recognize the variable and depending upon that this train must drive straight out or to the left/right. but there should be another train over these switches, so with another variable for example 1231. (no automatic train)

It would be really helpful if you want to help me, I have a script but it only works with clickdetector. That's not what I want to achieve with it.

Thanks for reading

1 answer

there's a no spoon feeding rule, also learn how to use region3/touched

4 comments

0

basically, you can achieve this by using region3 or a ontouch event

0

but i don't know how to script it, i can already script but i'm still too bad for that

0

using on touch is easier, try doing that, look here: https://developer.roblox.com/en-us/api-reference/event/BasePart/Touched

0

thanks for the help but how do I do that with the variables?

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