Difference between revisions of "Lua:AddSchedule"
From Fortress Forever Wiki
Jump to navigationJump to searchLine 8: | Line 8: | ||
===Input=== | ===Input=== | ||
− | schedule_id(string) Gives the schedule a name | + | <ul> |
− | duration(float) number of seconds the schedule will wait before firing | + | <li>schedule_id(string) Gives the schedule a name</li> |
− | function(function) the lua function that will be activated | + | <li>duration(float) number of seconds the schedule will wait before firing</li> |
− | ...(object) OPTIONAL. Any further parameters will be passed on to the target function | + | <li>function(function) the lua function that will be activated</li> |
− | + | <li>...(object) OPTIONAL. Any further parameters will be passed on to the target function</li> | |
+ | </ul> | ||
===Output=== | ===Output=== | ||
Returns nothing. | Returns nothing. |
Revision as of 14:17, 10 May 2009
AddScheduleA schedule allows you to fire a lua function, after waiting x number of seconds. UsageAddSchedule(schedule_id, duration, function, ...) Input
OutputReturns nothing. ExampleAddSchedule must refer to a user-defined lua function. AddSchedule( "my_schedule", 3.3, DoSomething, "hello") --This function can be defined anywhere in the file--wherever is convenient. function DoSomething (myString) --myString now equals "hello" --Do other stuff end |