Why does this script not update the gui? there is no errors, I have confirmed the counter script to work, and it is a local script with its paretn being a screengui in StarterGui
01 | local minutes = game.workspace.GlobalTime.Minutes.Value |
02 | local seconds = game.workspace.GlobalTime.Value |
03 | local Colon = game.workspace.GlobalTime.Colon.Value |
04 | local text = script.Parent.Gui.TextLabel.Text |
05 | while true do |
06 | if seconds = = 0 then seconds = "00" |
07 | else seconds = game.workspace.GlobalTime.Value end |
08 | wait( 0.3 ) |
09 | text = minutes..Colon..seconds |
10 | if seconds = = 0 then seconds = "00" |
11 | else seconds = game.workspace.GlobalTime.Value end |
12 |
13 | end |
This is my method
You need a StringValue in ReplicatedStorage. Lets call this value Status and insert a script in ServerScriptService and type this.
1 | local status = game.ReplicatedStorage.Status |
2 |
3 | while true do -- This is a forever loop. |
4 | for i = 1 , 99 do -- this i = 1 is how much time will be subtracted |
5 | status.Value = "Intermission" .. 99 -i |
6 | wait( 1 ) |
7 | print ( "This gui has updated!" ) -- you can remove this |
8 | end |
9 | end |
then you need to go to the TextLabel and add a local script
1 | local status = game.ReplicatedStorage.Status |
2 |
3 | status.Changed:Connect( function () |
4 | script.Parent.Text = status.Value -- the text will change everytime the Status updates |
5 | end ) |