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

How do I make a day and night script?

I am making a RP game called Blokville, and I need a day and night script. Just to make it more realistic as I am aiming for it to be the most realistic roleplay game on ROBLOX. It sounds a bit silly but I really do.

1 comment

0

This is not a request site. Please attempt this yourself, and we can help you with the code. The Lighting service is a good place to start.

1 answer

Here's a way to do it:

local TODhr = 12
function setTODfromTODhr(hrNum)
	local TODstringhr = tostring(hrNum) .. ":00:00"
	return TODstringhr
end
while wait(2) do
	game.Lighting.TimeOfDay = setTODfromTODhr(TODhr)
	TODhr = TODhr + 1
end

P.S. as iaz3 said, this is not a request site. Try looking on the ROBLOX wiki

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