What is the issue you’re having?
What are you trying to do?
I’m trying to make peds spawn, but they dont spawn. They do spawn if i call it, and then call it again. You can see the Warning/error im getting. I dont know how to fix this.
What have you tried already to fix the issue?
I’ve tried to setnetworkid after creating ped, but still the same issue
Error screenshot (if any):
What did you do to get this issue?
local peds = {}
local function spawnAngryPed()
if Config.EnablePeds then
local coords = Config.Peds
AddRelationshipGroup(Config.PedsSettings.relationshipGroup)
RequestModel(Config.PedsSettings.model)
for i = 1, #Config.Peds do
peds[i] = CreatePed(30, 1456041926, coords[i].x, coords[i].y, coords[i].z, 266.00, true, false)
SetPedAsEnemy(peds[i], true)
SetPedRelationshipGroupHash(peds[i], Config.PedsSettings.relationshipGroup)
GiveWeaponToPed(peds[i], Config.PedsSettings.weapon, Config.PedsSettings.ammo, false, true)
TaskCombatPed(peds[i], GetPlayerPed(-1))
SetPedAccuracy(peds[i], Config.PedsSettings.accuracy)
SetPedDropsWeaponsWhenDead(peds[i], Config.PedsSettings.dropsWeapons)
SetPedCanRagdoll(peds[i], Config.PedsSettings.canRagdoll)
SetEntityHealth(peds[i], Config.PedsSettings.health)
SetPedSuffersCriticalHits(peds[i], Config.PedsSettings.suffersCriticalHits)
SetNetworkIdExistsOnAllMachines(NetworkGetNetworkIdFromEntity(peds[i]), true)
end
end
end
Anyone know how to fix this?