RegisterNetEvent('av_boosting:guards', function(guards,class) local guardsConfig = Config.Classes[class] local playerCoords = GetEntityCoords(cache.ped) SetPedRelationshipGroupHash(cache.ped, GetHashKey('PLAYER')) AddRelationshipGroup('GuardPeds') for _, v in pairs(guards) do local randomWeapon = #guardsConfig['Weapons'] local weapon = guardsConfig['Weapons'][randomWeapon] local guard = NetworkGetEntityFromNetworkId(v) SetPedDropsWeaponsWhenDead(guard, false) GiveWeaponToPed(guard, GetHashKey(weapon), 250, false, true) SetPedMaxHealth(guard, 500) SetPedArmour(guard, 200) SetCanAttackFriendly(guard, false, true) TaskCombatPed(guard, cache.ped, 0, 16) SetPedCombatAttributes(guard, 46, true) SetPedCombatAttributes(guard, 0, false) SetPedCombatAbility(guard, 100) SetPedAsCop(guard, true) SetPedRelationshipGroupHash(guard, GetHashKey("GuardPeds")) SetPedAccuracy(guard, 60) SetPedFleeAttributes(guard, 0, false) SetPedKeepTask(guard, true) SetPedSuffersCriticalHits(guard, false) TaskGoStraightToCoord(guard, playerCoords.x, playerCoords.y, playerCoords.z, 1, -1, 0.0, 0.0) local networkID = NetworkGetNetworkIdFromEntity(guard) SetNetworkIdCanMigrate(networkID, true) SetNetworkIdExistsOnAllMachines(networkID, true) SetPedCanSwitchWeapon(guard, true) Wait(25) end SetEveryoneIgnorePlayer(cache.ped, false) SetRelationshipBetweenGroups(0, GetHashKey("GuardPeds"), GetHashKey("GuardPeds")) SetRelationshipBetweenGroups(5, GetHashKey("GuardPeds"), GetHashKey("PLAYER")) SetRelationshipBetweenGroups(5, GetHashKey("PLAYER"), GetHashKey("GuardPeds")) end)