What solutions have you tried so far? I tried looking on the other forms but didn’t help at all so this is why I’m writing this
if script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
end
end
end)--my error is here this one line of code
I’m no pro, but it looks like you only have 1 ‘if’ statement, with a bunch of 'elseif’s inside it. I’d suggest removing the last 2 ‘end’ statements.
You also shouldn’t need a bracket at the end of this, unless it’s this is only part of the entire script and you have a function somewhere above the first line you posted.
I think that might have fixed it, all I did was remove the 3th end and then tested it and I think it works but I don’t know yet still messing around with it before I put solution.
oops i didnt see that there was two ends you dont need them basically just copy and paste this i have removed them and unindeted the code
if script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
end
if script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go2.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == true then
print("you may corss the streets the light is red")
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Sea green")
wait(0.5)
script.Parent.Parent.Side1.Go1.BrickColor = BrickColor.new("Black")
wait(0.5)
script.Parent.Parent.Side1.Go.BrickColor = BrickColor.new("Sea green")
elseif
script.Parent.Parent.Parent.RYG_Light1.Red.BoolValue.Value == false then
print("you may not cross the street as the light is not red")
end
end)--my error is here this one line of code