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?

local PlanetSpin = game.Lighting.GeographicLatitude

while true do
PlanetSpin.new = "+1"
end

if PlanetSpin == 360 then
local PlanetSpin = 0
end

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.

spawn(function()
    while true do
        game.Lighting.GeographicLatitude = game.Lighting.GeographicLatitude + .1 -- amount
        if PlanetSpin => 360 then
            game.Lighting.GeographicLatitude = 0
        end
        wait(.1) -- speed
    end
end)
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