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

[SOLVED] My IntValue.Changed trigger doesn't work?

Hey guys, I did what one person said, and until now it worked flawlessly. The thing is, it doesn't anymore - am I missing something?

Script

ApplyTime()

while TimeText.Text == '0:0 ET' do
	
	TimeText.Text = "Time not specified!"
	
end


while true do
	
wait(0.1)
Hours.Changed:connect(ApplyTime)
Minutes.Changed:connect(ApplyTime)
	
end

ApplyTime() - Yes, I know, useless, but my thing :)

TimeText.Text = Hours.Value .. ':' .. Minutes.Value .. " ET"

All of the directories and paths are correct (atleast by my tests)

local Hours = Variables.TV_1SessionTime.Hours
local Minutes = Variables.TV_1SessionTime.Minutes
local TimeText = script.Parent.Time

Thanks in advance!

4 comments

0

can you show the entire ApplyTime function code block

0

What is the point of the while loop on line 03? Couldn't it just be an if?

0

That's all :D

0

@fredfishy Well, it didn't worked other way..

1 answer

✓ Accepted answer

While binding to events inside a loop is sometimes acceptable, this is not one of those times.

Try just:

if TimeText.Text == "0:0 ET" then
    -- I changed this to an `if` because I'm not really sure what the point of
    --   using a `while` loop here is.
    TimeText.Text = "Time not specified"
end

Hours.Changed:connect(ApplyTime)
Minutes.Changed:connect(ApplyTime)

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