[Help] Attempting to automatically trigger a event (based on in game time)

Good day,

I was scratching my head over here attempting to obtain the “in game time” for a if/then .lua statement.

But thanks to @Cosmo i got things up and running using his suggestion:

if GetClockHours() == 7 and GetClockMinutes() == 0 and GetClockSeconds() == 0 then
– Do Stuff at 7:00
end

  • Thanks again!

PS: Big Thanks to @Scott and @Antivirus-chan for their help on the FiveM Discord!

Have you tried:

if GetClockHours() == 7 and GetClockMinutes() == 0 and GetClockSeconds() == 0 then
     -- Do Stuff at 7:00
end
1 Like