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

TextLabel's Text not Updating?

Asked by 4 years ago
Edited 4 years ago

I have been struggling with this for a while now, and i felt like reaching out to the scripting community for help, the point is, I'm trying to update this text to every second, but nothing is happening, it even gets to that part, but no updating.

Code:


local text = script.Parent.Text while true do wait(1) print("got here") for e = 10,0,-1 do print("got here") wait(1) text = "The Plane Will Arrive in"..e.." Seconds!" end wait(1) for i = 30,0,-1 do wait(1) text = "The Plane Will Leave in "..i.." Seconds!" end for q = 115,0,-1 do wait(1) text = "The Plane Will Regen in"..q.." Seconds!" end end
0
oh god why don't you just use for loops and a single while loop instead of that greatneil80 2647 — 4y
0
i tried that but, i thought the for loops and while loops were the problems, i'll change it so it'll look better goodnoodle13 39 — 4y
0
done. goodnoodle13 39 — 4y

1 answer

Log in to vote
0
Answered by
Dfzoz 489 Moderation Voter
4 years ago
Edited 4 years ago

If you create a variable called text = script.Parent.Text, it will return the text of the textlabel that was set at the time, and not a directory for the textlabel property itself. For example, if the textlabel text was "Hello World" and you reference it, the variable will be a string saying "Hello World", even if you change the actual textlabel text to something like "Planes are awesome".

Instead, use script.Parent.Text = textyouwanttouse

0
Didnt know text worked that way, Thanks! goodnoodle13 39 — 4y
Ad

Answer this question