• Weird timer error
    8 replies, posted
I'm getting this and i have no idea what to do with it [lua] Hook 'CheckTimers' Failed: invalid key to 'next' [/lua]
code?
I just set up a normal timer like so [lua] timer.Create("name",0.01,0,function() print("test") end) [/lua]
I dont think you can have 0.01 in there.
You can have decimals in there, I am not sure of the lower bound tho. Try [lua]timer.Create("name", 0.1, 0, function() print("test") end) [/lua] If that works, your timer interval was too low.
Hm, i tried it with 1 and it still failed. [editline]06:55PM[/editline] Actually, fixed it using a Think hook with a delay.
That is very odd though, as I use a timer with a 0.1 interval as well. Are you sure you actually used function () print("test") end or did you just put that as an example?
try this: [lua] timer.Create( "name", 0.1, 0, function() print( "test" ) end end )[/lua] [editline]09:10PM[/editline] You forgot to end the function [editline]09:11PM[/editline] Nevermind, you don't need to end the timer. So scratch my idea. [editline]09:11PM[/editline] Can you show us the hook?
Well, the thing is. The timer works fine in create multiplayer/singleplayer but as soon as i lug my gamemode off to my server, it starts giving me that error Think timer code [lua] local var = delay + CurTime() hook.Add("Think","timer",function() if var < CurTime() then -- Timer foshizzle var = delay + CurTime() end end) [/lua]
Sorry, you need to Log In to post a reply to this thread.