Hi.
There was an update just as I was gonna launch Garry's Mod (what are we on now, 2015.06.01) and all of a sudden the timer.Adjust function isn't working. I can't vouch for all the mods, but with my small experiments, a timer.Adjust inside a timer.Create is no longer working...
[code]
timer.Create("check_move",2,1,function()
print("Timer Created")
timer.Adjust("check_move",0.1,0,function()
print("Timer Adjusted")
if(!IsValid(ragent) or !IsValid(npcent)) then
timer.Stop("check_move")
return
end
rags_eol()
end)
end)
[/code]
A simple code like this, the "Timer Created" is printed, but the "Timer Adjusted" isn't. Worked fine yesterday. Broken or Deprecated? If Deprecated, what's the alternative?
I kind of have the same problem. I had a countdown timer that worked fine before the update, and for some reason it's not working anymore. I will tell you if I find out anything that could fix the problem.
"timer.Adjust has its 4th argument optional now" ([url]http://www.garrysmod.com/2015/06/01/15-06-01/[/url])
They did touch timer.Adjust, but the page about timer.Adjust on the wiki ([url]http://wiki.garrysmod.com/page/timer/Adjust[/url]) doesn't give any good information on that change, and I don't truly understand as the "4th argument" is the function.
[QUOTE=TheKitsune;47856250]"timer.Adjust has its 4th argument optional now" ([url]http://www.garrysmod.com/2015/06/01/15-06-01/[/url])
They did touch timer.Adjust, but the page about timer.Adjust on the wiki ([url]http://wiki.garrysmod.com/page/timer/Adjust[/url]) doesn't give any good information on that change, and I don't truly understand as the "4th argument" is the function.[/QUOTE]
That's not why it's broke.
"Adjusts the timer [B]if the timer with the given identifier exists[/B]."
Maybe the update broke that? Try it without having timer.Adjust inside timer.Create. Maybe it's just that the identifier is set after the function is called (That would be weird, but we never know).
I couldn't find timer.Adjust on the Garry's Mod GitHub, so I can't confirm you that.
At least have an error message, like "Can't find timer: 'check_move'".
Also, how would I go about adjusting the timer after 2 seconds? Or will I have to nest in a new timer.Create?
I don't know right now. I was just trying to find why it would be broken. I have no other ideas on why it could be.
Sorry, you need to Log In to post a reply to this thread.