I'm trying to make a light system, so when a red light shows, the max speed of the car is turned to 0 so nobody will be able to move, when the light is turned to amber (gold) the car will only be able to get to 40 and when it is green, the car will be able to go to 60. I have tried a few different ways, this script is in the kart. I have also tried a function type when when the red light button is pressed it changes the cars speed but nothing seems to be working. Any help is appreciated :)
if workspace.Lights.Light1.BrickColor == ("Really red")
then
workspace.Karts.Kart1.Seat.VehicleSeat.MaxSpeed = 0
else
if workspace.Lights.Light1.BrickColor == ("Gold")
then
workspace.Karts.Kart1.Seat.VehicleSeat.MaxSpeed = 40
else
workspace.Karts.Kart1.Seat.VehicleSeat.MaxSpeed = 60
end
end

3 comments
Also missing an while loop
How would I go about that?
I fixed it.