Textlabel visible when night not working

i tried making a textlabel visible when its 18:00, seems like it did not work, no errors on the output

script.Parent.Visible = false
local lighting = game:GetService("Lighting")
while true do
	wait(1)
	if lighting:GetMinutesAfterMidnight() < 360 then
		script.Parent.Visible = true
		wait(1)
		while script.Parent.TextTransparency > 0 do
			script.Parent.TextTransparency = script.Parent.TextTransparency - 0.1
		end
		script.Parent.Visible = false
		script.Parent.TextTransparency = 0
	end
end

this is my daynight cycle script:

local dayLength = 5

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()

	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end

	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false

is it because I set the time too quick?

while true do
wait(1)

if lighting:GetMinutesAfterMidnight() < 360 then

script.Parent.Visible = true 

for i = 1, 0, -0.1 do
        wait()
      script.Parent.TextTransparency = i
end
else
script.Parent.Visible = false
script.Parent.TextTransparency = 1 --You want this to be set to 1 and not to 0.
end end