My script:
local part = script.Parent
while true do
wait(0.1)
if game.Lighting.ClockTime < 6.1 then
game.ReplicatedStorage.MoonScript.Parent = game.Workspace.TelescopeLookoutTeleporter
part.SunScript.Parent = game.ReplicatedStorage
end
if game.Lighting.ClockTime > 6 then
game.ReplicatedStorage.SunScript.Parent = part
part.MoonScript.Parent = game.ReplicatedStorage
end
end

1 comment
Cleaned up how your code visually looked for others to better read it