← Back to course
easy ✦ 75 Studs

Updating Text Live

Change a TextLabel from a script while the game runs, like a live counter.

A label that never changes is a sign. A label that updates while you play is a scoreboard. The jump between them is just setting the Text property from a script, and you already know how to set properties, so this is mostly about wiring it up in the right place.

GUI that updates on a single player’s screen usually runs from a LocalScript (note the “Local”), placed inside the GUI. A regular Script runs on the server; a LocalScript runs on the player’s own device, which is exactly where their screen lives.

local label = script.Parent:WaitForChild("TextLabel")
local count = 0

while true do
  count = count + 1
  label.Text = "Time: " .. count
  wait(1)
end

Look how much of this you already own. A while true do loop with wait(1) from the loops course, string concatenation with .. from foundations, and setting a property from Roblox essentials. That’s the pattern of this whole site clicking together: new lessons are mostly old skills in a new spot.

WaitForChild("TextLabel") is the one fresh piece. It pauses until the label exists before grabbing it, which protects you from “I tried to use it before it loaded” errors. Run the checklist and watch your counter climb. When the number updates live, mark it done.

Build this in Roblox Studio, then check off each step: