function evalTargetLootable(address) local target = CPawn(address); if not ( target.Lootable ) then return false; end return true end function lootBodies() repeat local Lootable = player:findEnemy(false, nil, evalTargetLootable) if Lootable and player.Battling == false then player:target(Lootable) player.TargetPtr = Lootable.Address player:loot() end until not Lootable or player.Battling end