Hi I'm making a moon phasing script and I ran into a problem. I checked the output and nothing seems to be wrong with it, when really there is. I can't get the decal to switch at the time it's supposed to, instead it wants to switch every time the game opens.
Here's the script:
local c = game.Lighting local tod = "5:45:00" local time = game.Lighting.TimeOfDay local todd = tod .. time c.Sky.SunAngularSize = 6 -- these are just tests c.Sky.MoonAngularSize = 4 if todd then c.Sky.MoonTextureId = "http://www.roblox.com/asset/?id=4517662278" end
The script is only running once because you haven't wrapped the "if" in a while true do. You must be constantly checking if the time is equal to that value.
local c = game.Lighting local tod = "5:45:00" local time = game.Lighting.TimeOfDay local todd = tod .. time c.Sky.SunAngularSize = 6 -- these are just tests c.Sky.MoonAngularSize = 4 while true do if todd then c.Sky.MoonTextureId = "http://www.roblox.com/asset/?id=4517662278" end wait() end