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

Simple script to make a part visible at a specific time of day will not work?

I do not know how it is unable to operate, but here is what it is supposed to do.

An invisible brick in the workspace has a script inside of it that will make it visible at 18:00:00, but it will not work, I have a fair feeling that the day/night script in the workspace is preventing it from operating, but here is the script.

if game.Lighting.ClockTime == 18 then
	script.Parent.Transparency = 0
elseif
	game.Lighting.ClockTime == 8 then
	script.Parent.Transparency = 1

end

Simple script, although I cannot come up with any solutions.

1 answer

✓ Accepted answer

You should be checking every time the clocktime changes using GetPropertyChangedSignal, in which case, the script should look something like:

Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function() -- "ClockTime" can be exchanged for any property and this function exists for any object with a property.
	if ClockTime == time then

	elseif  then
	
	end
end)

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