Hey guys, scripting a GUI to show the time according to IntValues.. The thing is, I want them to change immediately (or with some delay) when the IntValue value changes. I included my Explorer and the script.
Variables = game.Workspace.Variables script.Parent.Visible = true while true do script.Parent.Time.Text = Variables.TV_1SessionTime.Hours.Value..":"..Variables.TV_1SessionTime.Minutes.Value wait(0.1) script.Parent.Time.Text = Variables.TV_1SessionTime.Hours.Value..":"..Variables.TV_1SessionTime.Minutes.Value end
Why won't it update the GUI????
Conveniently, all *Value
types have an overridden Changed
event which you can use to do something when the value changes.
local function changeTime() Time.Text = Hours.Value .. ":" .. Minutes.Value end Hours.Changed:connect(changeTime) Minutes.Changed:connect(changeTime)
At that point, all you need to do is make sure that Hours
and Minutes
are actually being changed the way you think they are.