Sorry i mistake, edited function:

function setGuardRelations(GuardList )
for key, guard in ipairs(GuardList) do -- we iterate the GuardList i forget the correct way to iterate a list with Lua, this will should be ok, note the ipairs(GuardList) edit
    SetPedRelationshipGroupHash(guard, GetHashKey(“armymen”)) -- for each Guard we set the ped relation
end
end

1 Like