I'm trying to make a text in a gui, (TimerText), be set to the value of TimeValue. It seems that TimerText is not updating although it is ran in a while true loop. I made sure that TimeValue is being changed through prints, so that shouldn't be the problem. Does anyone have any ideas of what I'm doing wrong?
local TimeValue = game.StarterPlayer.StarterPlayerScripts.LocalTimer.Time.Value local TimerText = game.StarterGui:WaitForChild("ScreenGui"):WaitForChild("Timer").Text while true do TimerText = TimeValue wait(.1) end
TimerText is a string. You want the object. You also want to put the variables in the loop so it fetches the updated values
local TimerText = game.StarterGui:WaitForChild("ScreenGui"):WaitForChild("Timer") while true do local TimeValue = game.StarterPlayer.StarterPlayerScripts.LocalTimer.Time.Value TimerText.Text = TimeValue wait(.1) end
You can shorten it more but no need. If you have any questions or if something doesn't work, comment below and I'll reply. Make sure to click accept if it does work.