This is my way of doing this.
- script goldroom -1,{
OnGoldKilled:
sleep 1500; //Respawn time 1000 = second
.@mc = getmapunits(BL_MOB,"jupe_ele"); //Mob Count
.@pc = getmapunits(BL_PC,"jupe_ele"); //Player Count
for(.@i=0;.@i<getarraysize(.setting);.@i+=2)
if(.@pc >= .setting[.@i])
.@summon = .setting[.@i+1];
if(!.@summon && .@mc <= .initial)
monster "jupe_ele",0,0,"GOLD MOB",1002,1,strnpcinfo(0)+"::OnGoldKilled";
else
monster "jupe_ele",0,0,"GOLD MOB",1002,(.@summon-.@mc)+1,strnpcinfo(0)+"::OnGoldKilled";
end;
OnInit:
.initial = 50; //Normal Mob Count
setarray .setting[0],5,100,10,150,15,200; //Player Count, Mob Count{,PC, MC) (5 player = 100 monster, 10 Player = 150 monster.. etc..)
monster "jupe_ele",0,0,"GOLD MOB",1002,.initial,strnpcinfo(0)+"::OnGoldKilled";
end;
}