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

ScreenGUI not changing signs with the while true do script. How do I fix that?

Asked by 4 years ago

So I'm coding something for an MTA group, and the ScreenGUI's text is not looping, is it because I need to have the frame visible and invisible during that time. I know how to code it on a SurfaceGUI, but it doesn't work on ScreenGUI, Here's the code:

local display = (script.Parent.Parent.Frame.TextLabel)

while true do
    display.Text = "WEST HEMPSTEAD TRAIN"
    wait(1.5)
    display.Text = "NEXT STOP"
    wait(1.5)
    display.Text = "VALLEY STREAM"
    wait(1.5)
    display.text = "TRAIN 6900"
    wait(1.5)   
end

3 answers

Log in to vote
1
Answered by 4 years ago

You didn't capitalize the bottom .Text so that probably breaks it.

Ad
Log in to vote
0
Answered by 4 years ago

Remove the brackets in the variable since you don't need them and test again

0
What brackets? eyeball001 7 — 4y
0
Nguyen is right. He means remove the parenthesis in your variable. I think people in the UK call them brackets. AntiWorldliness 868 — 4y
Log in to vote
0
Answered by 4 years ago

Versus using variables, you might be able to do this:

while true do
    workspace.SurfaceGui.Text = "WEST HEMPSTEAD TRAIN"
    wait(1.5)
      workspace.SurfaceGui.Text = "NEXT STOP"
    wait(1.5)
      workspace.SurfaceGui.Text = "VALLEY STREAM"
    wait(1.5)
      workspace.SurfaceGui.Text = "TRAIN 6900"  -- Some of this may differ depending where the TextLabel is.
    wait(1.5)   

end

Answer this question