Bug Ped qui ne bouge pas dans mon zombiespawner

Bonjour la communauté.

j’ai un petit souci avec les spawn de mes peds enfin il spawn mais une partie attaque et l’autre partie reste figé il ne bouge pas même si je vais les provoqués

je vous inscrit le code juste en dessous :

Citizen.CreateThread(function() AddRelationshipGroup(« zombeez ») SetRelationshipBetweenGroups(5, GetHashKey(« zombeez »), GetHashKey(« PLAYER »)) SetRelationshipBetweenGroups(5, GetHashKey(« zombeez »), GetHashKey(« looters »)) SetRelationshipBetweenGroups(5, GetHashKey(« PLAYER »), GetHashKey(« zombeez »))

if Config.DisableTrafficAudio then
    StartAudioScene("CHARACTER_CHANGE_IN_SKY_SCENE")
end

SetAiMeleeWeaponDamageModifier(1.0)

while true do
	Wait(1)
	if #peds < maxZombies then
		x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
		
                
                        

		choosenPed = pedModels[math.random(1, #pedModels)]
		choosenPed = string.upper(choosenPed)
		RequestModel(GetHashKey(choosenPed))
		while not HasModelLoaded(GetHashKey(choosenPed)) or not HasCollisionForModelLoaded(GetHashKey(choosenPed)) do
			Wait(1)
		end

		local newX = x
		local newY = y
		local newZ = z + 999.0

		repeat
			Wait(1)

			newX = x + math.random(-maxSpawnradius, maxSpawnradius)
			newY = y + math.random(-maxSpawnradius , maxSpawnradius)
			_,newZ = GetGroundZFor_3dCoord(newX+.0,newY+.0,z, 1)

			for _, player in pairs(players) do
				Wait(1)
				playerX, playerY = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
				if newX > playerX - minSpawnDistance and newX < playerX + minSpawnDistance or newY > playerY - minSpawnDistance and newY < playerY + minSpawnDistance then
					canSpawn = false
					break
				else
					canSpawn = true
				end
			end
		until canSpawn

		ped = CreatePed(4, GetHashKey(choosenPed), newX, newY, newZ, 0.0, true, true)
		SetPedArmour(ped, 100)
		SetPedAccuracy(ped, 25)
		SetPedSeeingRange(ped, 10.0)
		SetPedHearingRange(ped, 1000.0)

		SetPedFleeAttributes(ped, 0, true)
		SetPedCombatAttributes(ped, 0, true)
		SetPedCombatAttributes(ped, 5, true)
		SetPedCombatAttributes(ped, 46, true)
		SetPedCombatRange(ped,2)
		SetPedAlertness(ped,3)


		--SetCanAttackFriendly(ped, true, true)
		--TaskWanderStandard(ped, 1.0, 10)
		--SetEntityVisible(ped, true)




		SetAmbientVoiceName(ped, "ALIENS")
		SetPedEnableWeaponBlocking(ped, true)
		SetPedRelationshipGroupHash(ped, GetHashKey("zombeez"))
		DisablePedPainAudio(ped, true)
		SetPedDiesInWater(ped, false)
		SetPedDiesWhenInjured(ped, false)
			--PlaceObjectOnGroundProperly(ped)
		SetPedDiesInstantlyInWater(ped,true)
		SetPedIsDrunk(ped, true)
		SetPedConfigFlag(ped,100,1)
		ApplyPedDamagePack(ped,"BigHitByVehicle", 0.0, 9.0)
		ApplyPedDamagePack(ped,"SCR_Dumpster", 0.0, 9.0)
		ApplyPedDamagePack(ped,"SCR_Torture", 0.0, 9.0)
		StopPedSpeaking(ped,true)

		walkStyle = walkStyles[math.random(1, #walkStyles)]
			
		RequestAnimSet(walkStyle)
		while not HasAnimSetLoaded(walkStyle) do
			Citizen.Wait(1)
		end
		
		SetPedMovementClipset(ped, walkStyle, 1.0)
		TaskWanderStandard(ped, 1.0, 10)
		local pspeed = math.random(20,70)
		local pspeed = pspeed/10
		local pspeed = pspeed+0.01
		SetEntityMaxSpeed(ped, 5.0)

		if not NetworkGetEntityIsNetworked(ped) then
			NetworkRegisterEntityAsNetworked(ped)
		end

		table.insert(peds, ped)
	end

	for i, ped in pairs(peds) do
		if DoesEntityExist(ped) == false then
			table.remove(peds, i)
		end
			
		playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
		pedX, pedY, pedZ = table.unpack(GetEntityCoords(ped, true))
		-- Delete far away unlooted dead zombies after 60 seconds
		if IsPedDeadOrDying(ped, 1) == 1 then
			if(Vdist(playerX, playerY, playerZ, pedX, pedY, pedZ) > 75.0)then
				-- Set ped as no longer needed for despawning
				--local dropChance = math.random(0,100)
				--Citizen.Trace("Delete unlooted dead Zombie")
				--RemoveBlip(blip)
				local model = GetEntityModel(ped)
				SetEntityAsNoLongerNeeded(ped)
				SetModelAsNoLongerNeeded(model)
				--DeleteEntity(ped)
				table.remove(peds, i)
			end			
		else
			playerX, playerY = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
			SetPedArmour(ped, 100)
			SetPedAccuracy(ped, 25)
			SetPedSeeingRange(ped, 10.0)
			SetPedHearingRange(ped, 1000.0)

			SetPedFleeAttributes(ped, 0, true)
			SetPedCombatAttributes(ped, 0, true)
			SetPedCombatAttributes(ped, 5, true)
			SetPedCombatAttributes(ped, 46, true)
			SetPedCombatRange(ped,2)
			SetAmbientVoiceName(ped, "ALIENS")
			SetPedEnableWeaponBlocking(ped, true)
			SetPedRelationshipGroupHash(ped, GetHashKey("zombeez"))
			DisablePedPainAudio(ped, true)
			SetPedDiesInWater(ped, false)
			SetPedDiesWhenInjured(ped, false)
			
			if pedX < playerX - despawnDistance or pedX > playerX + despawnDistance or pedY < playerY - despawnDistance or pedY > playerY + despawnDistance then
				-- Set ped as no longer needed for despawning
				local model = GetEntityModel(ped)
				SetEntityAsNoLongerNeeded(ped)
				SetModelAsNoLongerNeeded(model)
				table.remove(peds, i)
			end
		end
	end
end

end)