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

How come my script works in test mode but not play mode?

Asked by 7 years ago

So I am making a game and I have made a working day/night cycle. The cycle works in online mode as well as test mode, but I also wanted to turn global shadows off at night.I accomplished this and it works in test mode, but in play mode, it does not work. Here is my script:

minutesAfterMidnight = 840
while true do
    minutesAfterMidnight = minutesAfterMidnight + .05
    game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
    wait(.05)
    if game.Lighting:GetMinutesAfterMidnight() == 3.3 * 60 then     
        game.Lighting.GlobalShadows = true
    end
    if game.Lighting:GetMinutesAfterMidnight() == 20.80 * 60 then       
        game.Lighting.GlobalShadows = false
    end
end

This is inside a regular script, which is in the Workspace.

0
Try putting the script in the ServerScriptService folder. addictedroblox1414 166 — 7y

Answer this question