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

How do I make a sensor switch that detects variables?

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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

0
basically, you can achieve this by using region3 or a ontouch event MacGames007 114 — 3y
0
but i don't know how to script it, i can already script but i'm still too bad for that Batpuma02 0 — 3y
0
using on touch is easier, try doing that, look here: https://developer.roblox.com/en-us/api-reference/event/BasePart/Touched MacGames007 114 — 3y
0
thanks for the help but how do I do that with the variables? Batpuma02 0 — 3y
Ad

Answer this question