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

Failure in GeographicLatitude Day/Night?

Asked by 4 years ago

im making a script wich is a Day/Night that makes the Sun and the Moon spin around the Workspace, but... i don't see it working, what is going wrong here?

1local PlanetSpin = game.Lighting.GeographicLatitude
2 
3while true do
4PlanetSpin.new = "+1"
5end
6 
7if PlanetSpin == 360 then
8local PlanetSpin = 0
9end

1 answer

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
4 years ago

This should work for you. Upvote if it did.

Spawn(func) continues the code without it pausing at loops.

1spawn(function()
2    while true do
3        game.Lighting.GeographicLatitude = game.Lighting.GeographicLatitude + .1 -- amount
4        if PlanetSpin => 360 then
5            game.Lighting.GeographicLatitude = 0
6        end
7        wait(.1) -- speed
8    end
9end)
0
You didn't putted the PlanetSpin Variable, but anyways, its really useful, Thanks! NerfLambdaWarrior120 3 — 4y
0
And instead of using => i used == . So, doing that, it works NerfLambdaWarrior120 3 — 4y
Ad

Answer this question