Why Isn't the Text updating in my SurfaceGUI script?

My goal is that the text of a textlabel in a SurfaceGUI should be the value of a stingvalue. Whenever I change the stringvalue, so should the text. Oddly, it works when I first join the game in Roblox Studio, but once I change the value of the stringvalue via the explorer, the text doesn’t change. This is a serverscript located inside the SurfaceGUI.

while wait(0.1) do -- the wait is so the game won't crash
    local CurrentOwner = script.Parent.Parent.Parent.Parent.Parent.CurrentOwner -- Stringvalue
    local TEXTLABEL = script.Parent.TextLabel -- textlabel

    TEXTLABEL.Text = tostring(CurrentOwner.Value)
end

If there is a solution to this problem it would help a lot!

2 Likes

Are you changing the value in PlayTest mode? The reason why it doesn’t change is because any changes to the explorer made in PlayTest are all local to the player. Considering this is not within a local system, you would need to change the value through the server. To do this, press Play Test, go to the Test Tab, and switch from Client → Server and make the change.

2 Likes