Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gui local script with no errors, doesn't update, why?

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


local minutes = game.workspace.GlobalTime.Minutes.Value
local seconds = game.workspace.GlobalTime.Value
local Colon = game.workspace.GlobalTime.Colon.Value
local text = script.Parent.Gui.TextLabel.Text
while true do
    if seconds == 0 then seconds = "00" 
    else seconds =  game.workspace.GlobalTime.Value end
    wait(0.3)
    text = minutes..Colon..seconds
    if seconds == 0 then seconds = "00" 
    else seconds =  game.workspace.GlobalTime.Value end
    
end

1 answer

✓ Accepted answer

This is my method

You need a StringValue in ReplicatedStorage. Lets call this value Status and insert a script in ServerScriptService and type this.

local status = game.ReplicatedStorage.Status

while true do -- This is a forever loop.
	for i = 1,99 do -- this i = 1 is how much time will be subtracted
		status.Value = "Intermission"..99-i
		wait(1)
		print("This gui has updated!") -- you can remove this
	end
end

then you need to go to the TextLabel and add a local script

local status = game.ReplicatedStorage.Status

status.Changed:Connect(function()
	script.Parent.Text = status.Value-- the text will change everytime the Status updates
end)

1 comment

0

I mess up don't use a bool value use a string value i already edited though.

This discussion is preserved as it was. New answers, comments, and votes are closed.