Thanks.

This is what I have done:

Code:
(default of max_loops is 5000)


var dust_num=0;
var count_1=0;

function set_dust(){
while(1){

while(dust_num<40){
count_1+=1;
if(count_1>=4500){wait(1);count_1=0;}

temp.x=random(screen_size.x);
temp.y=random(screen_size.x);
temp.z=400+random(50);
vec_for_screen(temp.x,camera);
create(<dust1.bmp>,temp.x,dust);dust_num+=1;}

wait(1);}}



"count_1" will call "wait(1);" if the loop looped 4500 times.
But the dust sprites are not disappearing all the time so new
ones don't have to be created all the time.
"count_1" is not necessary but maybe it's saver.

Last edited by Freddy; 08/08/06 19:37.