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

Vehicleseat brick color isn't changing on contact with brick?

Asked by 8 years ago

I'm trying to make a script where a brick connected under the train hits a single brick (not grouped whatsoever) on the track named "TripCock", it'll turn the vehicleseat in the train the color red.

When ever the brick on the track comes into contact with the brick under the train, the seat stays the same color and does not change.

function onTouched(touch)
    if touch.Parent.Name == "TripCock" then
            script.Parent.Parent.Parent.Parent.Parent.R46ACar.Body.Part.BrickColor = BrickColor.Red()

        end
    end
script.Parent.Touched:connect(onTouched)

Note: All the "parents" in the script are correct, also "part" is the vehicleseat name

0
Do you get any errors? What in particular is wrong? Does it do anything? dragonkeeper467 453 — 8y
0
it does nothing, I will update my question scripthelpersorg 10 — 8y
0
you're reading touch.Parent.Name but you said the brick is not grouped whatsoever, so touch.Parent.Name is always going to be workspace. 1waffle1 2908 — 8y

Answer this question