timer.Create not working

Hai!
So I’m quite a beginner in lua, but kinda know how to work in it.

I’m creating a lil’ something for our Gmod (TTT) server, and it requires a function to be executed on an interval.

So after a quick search on the Gmod wiki I came across timer.Create.
I followed the template on the wiki, tested with multiple options, but nothing seemed to work.
I’m not getting any lua errors, the function simply isn’t being executed, at all.

My code:



local function fileReading()
--Code which works 100% fine, the problem is just the timer.
print("Function has been initiated!")    
end
function CreateTimer()
timer.Create("Gilbert's amazing timer", 5, 5, fileReading)
  end
CreateTimer()


I have read that in around 2012 timer.Create was broken, but is it really still not supposed to work?
And if it isn’t, are there any ways I can run a function on an interval without timer.Create?

Thanks in advance
-GilbertGobbels (Yes, there are supposed to be 2 'b’s, nickname max prevented me from using it though :wink: )

Timers don’t run when the server starts. They will start to run when a player joins. You can get past this by using the sv_hibernate_think cvar. Put this in your server.cfg

That seemed to work, thanks a lot :smiley: