That means you are missing an end
it should be:
function name()
script.Parent.BackgroundTransparency = script.Parent.BackgroundTransparency - 0.10
if script.Parent.BackgroundTransparency == 0 then
workspace.Lighting.TimeOfDay = "0:00:00"
end
end
Also if that doesn’t work it might be because time of day is property of the lighting service in that case you could do:
local Lighting = game:GetService("Lighting")
Lighting.TimeOfDay = "0:00:00"