I don't understand, what exactly does if(!%oct = %obj.getCount()) do?
it's the same as
%oct = %obj.getCount();
if(!%oct)and you could also replace
if(!%oct) with
if(%oct == 0)If %obj.getCount() returns false I believe.
basically, except that's a more confusing way of stating it because it returns a value that's meant to be an integer and not a boolean
...i think i just realised, if there's no bricks in the brickgroup, does it actually return -1 instead of 0?