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

Is there a way to change text when it reaches a certain TimeofDay?

if game.Lighting.TimeOfDay== ("14:00:00") then
	game.StarterGui.yet.TextBox2.Text = ("Free Time")
end

is what i typed, and it says it works, but nothing happens when that time is reached.

2 comments

0

Have you made sure the time of day is changing?

0

yes

1 answer

✓ Accepted answer

Are you using an event to detect change? If not, here's an example of how you can detect if the TimeOfDay is changing.

local Lighting = game:GetService("Lighting")

Lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(function()
	print(Lighting.TimeOfDay)
	-- the code inside here will run any time Lighting.TimeOfDay changes, allowing you to do
	if Lighting.TimeOfDay == "14:00:00" then
		print("free time")
	end
end)

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