Hi everyone! I've working on a NPC that greet you with a GUI (Text label).
I want to make a text label that contain "Good morning" / "Good afternoon" / "Good evening".
Here is the local script:
local player = game.Players.LocalPlayer
game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
if game.Lighting.ClockTime >= 5 and game.Lighting.ClockTime >= 11 then
script.Parent.Text = "Good morning, " .. player.Name .."! Welcome to the hotel! What can I do for you?"
elseif game.Lighting.ClockTime >= 12 and game.Lighting.ClockTime >= 19 then
script.Parent.Text = "Good afternoon, " .. player.Name .."! Welcome to the hotel! What can I do for you?"
elseif game.Lighting.ClockTime >= 20 and game.Lighting.ClockTime >= 4 then
script.Parent.Text = "Good evening, " .. player.Name .."! Welcome to the hotel! What can I do for you?"
end
end)
But the NPC don't detect which hour it is...someone can say me which is the problem or what I should do to make it work?
Thanks!

1 comment
How to detect if is it day, afternoon or night by a script?* Sorry for the writing