Quote:
Originally Posted by greggiles
OOh ok. Well I have one more question, is there necessarily anything wrong with the way I wrote it? (using multiple scheduleEvents)
Or is it just not reccomended to write it like that.?
|
Well, generally speaking, it's better to try to condense your code if you can. For example, if you have:
PHP Code:
function onCreated() {
this.chat = 1;
sleep(1);
this.chat = 2;
sleep(1);
this.chat = 3;
sleep(1);
this.chat = 4;
sleep(1);
this.chat = 5;
sleep(1);
this.chat = 6;
sleep(1);
this.chat = 7;
sleep(1);
this.chat = 8;
}
It's better to condense it like:
PHP Code:
function onCreated() {
for (temp.i = 1; temp.i <= 8; temp.i ++) {
this.chat = temp.i;
sleep(1);
}
}