timer.Create

[lua]timer.Create(“timer1”, 10, 1, Msg, "Test
")[/lua]

What is the 1 for?

Also here is another question.

[lua]timer.Create(“MyTimer” 5, RunConsoleCommand, “say”,“MY WEED IS DONE!!”)

function starttimer(ply)
timer.Start(“MyTimer”)
end
concommand.Add(“starttimer”, starttimer)

function stoptimer(ply)
timer.Stop(“MyTimer”)
end
concommand.Add(“stoptimer”, stoptimer)[/lua]

The error is



:1: ')' expected near '5'


But, I have ended it…

1 is the number of repetitions, 0 for infinite.

In your code you forgot a comma between “MyTimer” and 5. You also forgot the number of repetitions.

Thats how many times it should run the timer, in this case only once.
**[Timer.Create

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Timer.Create)**

[lua]timer.Create(“MyTimer”, 5, 1, RunConsoleCommand, “say”,“MY WEED IS DONE!!”)[/lua]
You forgot 1 comma and 1 argument(the I one explained in my answer to your first question)

EDIT:
I was working on this post when Crazy Quebec posted… Ah well…

[lua]timer.Create(“MyTimer”, 5, 1, function() RunConsoleCommand( “say”,“MY WEED IS DONE!!”) end)[/lua]