Timer Trouble

Hello there,

I am trying to run a basic timer and it simply refuses to fire. In the server side init.lua file I run the following

[LUA]
function GM:Initialize()
timer.Simple(5, function() print(“Test Timer.”) end)
end
[/LUA]

The timer never prints to the console output. I have tried changing variables and checking to see if that works, but that doesn’t work either. Nor does using timer.Create(…)
Are there any special includes I need in order to use timers, or perhaps are they succeeded with a new framework? I am using the latest version of GMOD 13 downloaded through steamCMD. Any help is greatly appreciated.

Are you sure you’re looking at the servers console? If you run it in singleplayer mode then it should print. But if you have it set to >= 2 players then you won’t be seeing that print.

function GM:Initialize()
timer.Simple(5, function() print(“Test Timer.”) end)
end

no, 2zoeTssS 2fzYU7o8 EmGV2Q4Y 68Ne8hgt Gk8M3RkF V2DnyznE XcyyyMiN m9fyGemr g46vg5sJ DBhQwngo TxAk6FnJ X8gFb34C bfrNg7Bm GsByECu8 rtPYp8J6 J7u8L5M9 gCmL6468 Nvfr4VMA 6sawxGfq 8W998qzu BFxeRWB8 pDbvcu3T bQiZGBna RemKJpZa bwnxZfkn hRh2f3TW yrvt3Qc7 8PfEYPic qyzbwsnr odfziihr QeMUdZTV tc6Ur2bt PkpgNJJh EMdUze6N 6KyudCbH 5TMycSC4 uRDoGzz9 TJsdfVGk xUs3L7rF MEWryhqD 5aoFKfzm RUpC2MBD ehiPi38j MnT2vYeE R5MA4WYt nBC2iLSA FGHrkrjN KdeetiJb vgSpgjvs VW6WBZ4o CmwmJzHU SYoQT9vD UwPWjBnq qDKZn5vn 2CAF3ZCf Uhxz4dTv 8DjoNSHL HZocDpEC UPfV6WeF CeZgK6G2 MCZU4ozY tvk24Kj4 Tq49Naz3 PwNmnEmg qmn5s99n dy8Ab5ob fmqjmxcE wzWeNhAv eHFvQpiH 6RyqinjM rqtaekUd 2FEtZoH3 ojcYNpSd LeMvb4JJ YUbkBgRa Lp4xiDUz UEEnFQ4R zKwC6u2U aiM6HYAc x5TLwM8W RhKbCM5E 3hSPgskp 7y4jfpRp BtZr89jp tauu6KHU HSeEjRLD 3oBEnSRF i8vts4pA rWJ6V5P4 452C9UDT Ri8vBbqi PFrEmqzB Bh9F8u7e Fq79Ptqu hXdpsBu4 QNF3cxJB Y2MczBuT pQKNXSt9 ZVNhXckF stFwCtVt

I should be seeing the developer logs. I’ve run print(…) in other locations and seen the output. Do timers rely on how many players there are on a server when determining if they should fire? I can post the code and output when I get home to show you what it does and does not do.

Edit:
Here is the gamemode in full:

shared.lua
[LUA]
GM.Name = “Test Server”
GM.Author = “Chad”
GM.Email = “”
GM.Website = “”

// Variables
GM.TeamBased = true
[/LUA]

cl_init.lua
[LUA]
include(“shared.lua”)
[/LUA]

init.lua
[LUA]
AddCSLuaFile(“shared.lua”)
AddCSLuaFile(“cl_init.lua”)

include(“shared.lua”)

function GM:Initialize()
print(“About to init”)
timer.Simple(5, function() print(“Success.”) end)
print(“Done initializing… wait 5 seconds for prompt.”)
end
[/LUA]

Console Output:

I waited a few minutes before taking this screenshot of the output. There doesn’t appear to be any particular reason why the timer isn’t firing as far as I can tell. I’ll try removing the GM.TeamBased variable to see if that might be causing the issues. Any pointers would be great!

No Player = All timers are halted. use the console command “bot”, and the timer’s will run.

Thanks Leystryku, adding a bot to the server did cause the timers to fire. Didn’t know there needed to be bots on to test that!