I am working on a horror game, and it has a day and night cycle. After 10 minutes of night, there is five minutes of day (to act as a safe time). My current script will not loop.
This is the code to my script:
wait(600)
game.Lighting.ClockTime = 12
wait(300)
game.Lighting.ClockTime = 1
2 Likes
while true do
:: your script
end
1 Like
while true do
wait(600)
game.Lighting.ClockTime = 12
wait(300)
game.Lighting.ClockTime = 1
end
1 Like
Thank you! this will speed up my development by a ton!
1 Like
You’re welcome!
You can learn more about loops here…
1 Like
GetStyled
(GetStyled)
May 20, 2022, 9:39pm
#6
while true do
–script
end
game:GetService(‘RunService’).Heartbeat:Connect(function()
–script
end)
repeat
–script
until --goal
1 Like