Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)
0
I mess up don't use a bool value use a string value i already edited though. Eric_pokemon 133 — 4y
Ad

Answer this question