I'm trying to make a sound play when a raid starts which begins at a specific time, (irl time) but when I tried to print something it didn't work.
local hour = os.date("!*t") ["hour"]
local minute = os.date("!*t") ["min"]
if hour == 7 and minute == 5 then
print("Hmm")
end
(I used print just to test it)
[EDIT]
local hour = os.date("!*t") ["hour"]
local minute = os.date("!*t") ["min"]
while true do
wait() --i added this so my game doesnt break
if hour == 2 and minute == 55 then
print("Hmm")
end
end

9 comments
its important to know os.date uses UTC so maybe it didnt pass that
converts your hour to UTC hour
That code will only check once as soon as the game runs, so if it's not the correct time as soon as you hit the start button it wont work. You could put it in a loop instead to repeatedly check.
@prolua I know it goes to UTC I just changed it
@mattscy I added a loop but it still didn't print
while true do
What other loop would I use??
It works fine for me. Show us the updated version with your while loop.
@Cousin_Potato added it