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?
1 | local PlanetSpin = game.Lighting.GeographicLatitude |
2 |
3 | while true do |
4 | PlanetSpin.new = "+1" |
5 | end |
6 |
7 | if PlanetSpin = = 360 then |
8 | local PlanetSpin = 0 |
9 | end |
This should work for you. Upvote if it did.
Spawn(func) continues the code without it pausing at loops.
1 | spawn( 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 |
9 | end ) |