| Blockland Forums > Modification Help |
| Schedules |
| (1/4) > >> |
| Wheatley:
How exactly do schedules work? I'm just now trying to use them, but I'm not sure how they work. Could somebody give me the correct syntax? |
| MegaScientifical:
schedule(TIMEINMILLISECONDS, OBJECT (USUALLY 0 FOR NONE), COMMAND, PARAMETER1, PARAMETER2, PARAMETER3, ...); Ex: schedule(3000, 0, serverCmdMessageSent, %client, "And 3 seconds later..."); OBJECT.schedule(TIMEINMILLISECONDS, COMMAND, PARAMETER1, PARAMETER2, PARAMETER3, ...); Ex: %client.player.schedule(3000, addVelocity, "0 0 600"); |
| Amade:
You can also assign schedules to variables so that you can cancel them. For example: %obj.deathSched = %obj.schedule(10000, kill); And then to cancel it: cancel(%obj.deathSched); |
| Nexus:
--- Quote from: Amade on July 23, 2011, 02:06:22 PM ---You can also assign schedules to variables so that you can cancel them. For example: %obj.deathSched = %obj.schedule(10000, kill); And then to cancel it: cancel(%obj.deathSched); --- End quote --- Thats not a variable though. Assigning it to a variable to cancel it would be like: $var = schedule(youknowtherest); if(iseventpending($var)) cancel($var); |
| ZSNO:
--- Quote from: Nexus on July 23, 2011, 10:14:26 PM ---Thats not a variable though. Assigning it to a variable to cancel it would be like: $var = schedule(youknowtherest); if(iseventpending($var)) cancel($var); --- End quote --- Since when was an object's variable not a variable....? |
| Navigation |
| Message Index |
| Next page |