for _, obj in ipairs(list) do
if (obj:is_player() and (obj:get_player_name() == name)) then
if (obj:is_player() and (obj:get_player_name() == args)) then
-- Rest of code
end