I want to make a GUI visible in my game, my code is
while wait(0.1) do if game.Lighting:GetMinutesAfterMidnight() > 8 * 60 then script.Parent.Visible = true end if game.Lighting:GetMinutesAfterMidnight() > 10 * 60 then script.Parent.Visible = false end end
(Sorry for the bad spacing im new to the website and idk how to do the formats and spacings, any help will be appreciated. Thx a lot.)
while wait(0.1) do if game.Lighting:GetMinutesAfterMidnight() > 8 * 60 then script.Parent.Visible = true end if game.Lighting:GetMinutesAfterMidnight() > 10 * 60 then script.Parent.Visible = false end end
btw heres the formatted script but idk why it doesnt work
not sure if you have solved this already but something like this could work
game:GetService("Lighting").Changed:Connect(function() local minutes = game:GetService("Lighting"):GetMinutesAfterMidnight() if minutes > 8 * 60 and minutes < 10 * 60 then script.Parent.Visible = true else script.Parent.Visible = false end end)
this works for me but im not entirely sure why yours wouldn't work