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
You need to also update the time variables inside the loop, otherwise they will be set only once at the beginning of the script and never again even as the clock increments.
while true do local hour = os.date("!*t") ["hour"] local minute = os.date("!*t") ["min"] if hour == 14 and minute == 17 then print("Hmm") end wait() end