Since engine version: 1.0 OC
Executes a specified script command after a specified delay.
bool Schedule(object obj, string script, int delay, int repeat);
- Object in which the call is to be made. Can be
nilfor no object context.
- Script to be executed.
- Delay after which the first call is made. If repeat is greather than 1, this is also the delay inbetween subsequent calls.
- Number of calls. If 0 or not specified, the call is made exactly once.
Accordingly, the specified script can be a single command only. It may not contain multiple commands separated by ";".
Schedule(FindObject(Find_ID(Clonk)), "Explode(50)", 1000);
Makes a clonk explode after 1000 ticks delay.
Schedule(nil, "DoWealth(GetPlayerByIndex(0), 1)", 1, 100);
Gives one unit of money per frame to the first player for 100 frames. Notice that if the first player is eliminated, the donations will continue for the next (first) player, since the receiving player is determined anew in each execution.
See also: ScheduleCall