ScreenGUI doesn't change even though TextLabel is

So to explain this quickly, I am making a round system for my game. I have 2 scripts. One that counts down to 0 for like an intermission. I use a for loop to update a stringValue found in Replicated Storage. The second script is a local script. This uses something called :GetPropertyChangedSignal() I think that this is supposed to update the PlayerGUI, but it isn’t. I also tried troubleshooting and checking if the textLabel was updating its text and it was. The screenGUI also has ResetOnSpawn ticked off./

Script One: Found in ServerScriptStorage

for i = 10,0,-1 do
  task.wait(1)
  stringValue.Value = "Intermission: "..i
  textGui.Text = stringValue.Value
 end

Script two:Local

local stringValue = game:GetService("ReplicatedStorage"):WaitForChild("Seconds")
local gui = game:GetService("StarterGui"):WaitForChild("ScreenGui")
local textGui = gui.TextLabel

stringValue:GetPropertyChangedSignal("Value"):Connect(function()
	print("SMTHN CHANGED")
	print(stringValue.Value)
	textGui.Text = stringValue.Value
	print(textGui.Text)
end)






I’m very new to using GUIs so I don’t know what the problem is here

1 Like

You’re not seeing the GUI update because you’re updating the graphical user interface inside StarterGui, not PlayerGui.
StarterGui just holds ScreenGuis that will be copied to the PlayersPlayerGuis when they first join and respawn, if ResetOnSpawn is true on the ScreenGuis.

If your LocalScript is parented under the ScreenGui, you can access it as script.Parent. Though, if it is parented to some other Instance like StarterPlayerScripts (the service that holds LocalScripts that will be cloned to PlayersPlayerScripts), you can access the ScreenGui from the Players.LocalPlayer’s PlayerGui.

-- This...
local gui = script.Parent

-- or that...

local Players = game:GetService("Players")

local player = Players.LocalPlayer
local playerGui = player.PlayerGui -- May need to use player:WaitForChild("PlayerGui").

local gui = playerGui.ScreenGui

-- Continue code down here...
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.