function somefunc(player) if (isElement(player)) then local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if isElement(element) and getElementType ( element ) == "blip" then -- do something with element end end end end end