#Need help with Day Time/ Night Time cycle with ACS gun system

40 messages · Page 1 of 1 (latest)

glad mason
#

I entered a script to add a day time/ night time cycle and I have the ACS gun system, and turns out it doesnt work with the acs gun system. Can somebody help me?
This is the script: local lighting = game.Lighting

while task.wait(0.1) do
lighting.ClockTime += 1
end

zenith light
#

did you put that on top of another script?

dense warren
#

why does acs have a day/night cycle

glad mason
#

I am not aware of it having a day/night cycle already implemented in ACS

glad mason
zenith light
#

Anything below this loop will not be executed

#

exept you do a corutine

glad mason
#

wym?

zenith light
#
while wait() do
    
end

print("hey")
```"hey" will only be Printed when the **INFINITE** loop ends
glad mason
#

so how do i fix it?

zenith light
#

that would work :

task.spawn(function()
    while wait() do
    
    end
end)

print("hey")
glad mason
#

ok ima try it

#

I put in "task.spawn(function()
while wait() do

end

end)

print("hey")" instead of the script i had and it isnt printing hey, i dont know if im stupid or something but sorry because i am a beginner with roblox studio

#

should i have kept the script i originally had and the script you showed me?

viral schooner
#

why are you guys using task.spawn

#

It’s useless unless you need actual multithreading, which can be just done with actors

zenith light
#

i just like it more than a normal corutine, i think it looks cleaner

viral schooner
#

Both are recommended to not use if not needed

glad mason
#

idk how to make it work

#

the day/night cycle

#

i think ACS is overriding it or something

viral schooner
#

I actually never researched anything on day night time

glad mason
#

it doesnt change the time when i put the script in

#

its always day

viral schooner
glad mason
#

which is kinda annoying

glad mason
#

and it doesnt work

#

its ACS

viral schooner
#

Weird

glad mason
#

idk how to disable the daytime there

#

well i guess there's nothing i can do about it right?

zenith light
#

i always use that code for day/night, maybe try that:

while wait() do
    game.Lighting:setMinutesAfterMidnight(game.Lighting:getMinutesAfterMidnight()+.1)
end
glad mason
#

ok ill try

#

server script service right?

zenith light
#

jap

glad mason
#

how long do i have to wait till midnight

zenith light
#

you can just chnage the speed, its that +.1 there or you change wait() to like wait(.1)

glad mason
#

well if the sun is supposed to be moving

#

then i guess it doesnt work for me because its not moving at all