The modules are a child of the script. If the script exists, so would the modules. Also im pretty sure require() has a built-in wait so something like this won’t be needed. At least I think ive read that somewhere before.
I don’t get why there is such a fuss.
The module process stops at Teleport, so Time Cycle might have a while loop or some sort of wait that blocks the for loop from minding it’s own business.
The easiest workaround to this is to wrap whatever’s causing the issue in the time cycle script in a different thread, or to just wrap the require in a different thread. (which I just demonstrated)
Couldn’t it be the other way around, since children are based on the parent, but parent isn’t based on the children existing?
@swatj1an But it’s about loading the modules right? So getting the children at a time when not all of the children are there would mean that it wouldn’t load in ones that got loaded in after. But what you said is right, if there is a yielding statement that would stop the execution of the other modules.
So I was in a rush wasn’t thinking straight after putting the while true do loop time cycle thing (that I just copied in the toolbox) into the modulescripts and I tried wrapping it and it works fine now
return function()
task.spawn(function()
while true do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+0.25)
wait(.2)
end
end)
end
Scripts in ServerScriptService don’t “Load in” as they are already there at run-time, because it’s the server, not the client. Stuff loads on the client, which is why you use WaitForChild a lot for client stuff. Server stuff should already instantly have access to things in its Storage locations.