Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Really simple 3-liner script not working?

Asked by
funyun 958 Moderation Voter
9 years ago

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
0
Where is this script located? BinaryResolved 215 — 9y
0
Lighting funyun 958 — 9y
4
Move it to ServerScriptService, then replace "script.Parent" with "game.Lighting" Redbullusa 1580 — 9y
0
Wow, I actually wasn't expecting that to work. Thanx Red. I'd accept that as an answer. funyun 958 — 9y

1 answer

Log in to vote
3
Answered by 9 years ago

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!

Ad

Answer this question