You can't remove from the allplayers array (which I wonder if it is trying to do instead of copying the array) so instead use it read-only, it's also more efficient this way:
PHP Code:
function onActionGrab()
{
while (true)
{
temp.pl = allplayers[int(random(0, allplayers.size()))];
if (temp.pl.computerfirstlogin == player.computerfirstlogin)
{
continue;
}
break;
}
echo("found" SPC temp.pl);
}