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

Really simple 3-liner script not working?

I'm trying to make a time script in the Lighting service that makes 1 minute of in-game time pass every 3 real-time seconds. For whatever reason, the TimeOfDay isn't changing at all, and the output isn't giving me any errors. I can't find any reason why this wouldn't work for me. Here's the script:

while wait(3) do
	script.Parent:SetMinutesAfterMidnight(script.Parent:GetMinutesAfterMidnight() + 1)
end

4 comments

0

Where is this script located?

0

Lighting

4

Move it to ServerScriptService, then replace "script.Parent" with "game.Lighting"

0

Wow, I actually wasn't expecting that to work. Thanx Red. I'd accept that as an answer.

1 answer

✓ Accepted answer

The reason for that is that scripts don't work in the Lighting. That's why the Lighting was such a common place to store tools before the Storage services were introduced.

Simply move the script into the Workspace and replace "script.Parent" with "game.Lighting"

Hope this helped!

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