while true do wait(0.05) if script.Parent.Parent.Control.Value == 0.03 then while true do script.Parent.a.SurfaceGui.TextLabel.Text = "This train Terminus here." script.Parent.b.SurfaceGui.TextLabel.Text = "You can exit this train" wait(5) script.Parent.a.SurfaceGui.TextLabel.Text = "or stay here" script.Parent.b.SurfaceGui.TextLabel.Text = "" wait(5) if script.Parent.Parent.Control.Value == 0.05 then script.Parent.a.SurfaceGui.TextLabel.Text = "Ad.test" script.Parent.b.SurfaceGui.TextLabel.Text = "Ad.test" end end end end
*This script not is full staple Wrong:The script do no to anything! Value:Number Value l need a fixed script
It looks to me that your end
s are not placed properly. Also, using the while true do
loop on the inside of the if
statement is incorrect. To avoid the problem I think you're trying to avoid, try using elseif
statements in place of every if
statement after the first. Also, try tabbing the code, so you can see the logic more clearly:
local a = script.Parent.a.SurfaceGui.TextLabel local b = script.Parent.b.SurfaceGui.TextLabel local Control = script.Parent.Parent.Control while true do wait(.05) if Control.Value == 0.03 then a.Text = "This train Terminus here." --"terminates" is the word you're looking for here. b.Text = "You can exit this train" wait(5) a.Text = "or stay here" b.Text = "" wait(5) --Note that there is no `end` here. The `elseif` does not get an end, only the `if`, but `elseif`s must be places within `if` statements. elseif Control.Value == 0.05 then script.Parent.a.SurfaceGui.TextLabel.Text = "Ad.test" script.Parent.b.SurfaceGui.TextLabel.Text = "Ad.test" end end