local function CheckMk1Eyeball(unit) local count = 0 local sensors = unit.sensors if sensors then for k,sensor in ipairs(sensors) do if sensor and string.find(sensor.sensor_name,'Mk1 Eyeball') then count = count + 1 if count > 1 then ScenEdit_UpdateUnit({ guid = unit.guid, dbid = 0, mode = 'remove_sensor', sensorId = sensor.sensor_guid }) end end end end end local sides = VP_GetSides() for _,side in ipairs(sides) do local units = VP_GetSide({side=side.name}).units for _,unit in ipairs(units) do local u = ScenEdit_GetUnit({guid=unit.guid}) if u and u.type ~= 'Group' then CheckMk1Eyeball(u) end end end