Di you manage to make so that animals attack ?
they dont spawn must i turn no-npc off?
i would assume so lol
Hello, the animals spawn once only, when they are gone. They wont respawn again. How can i solve it?
Awesome script!!
Now our hunting script is useful
So i was attempting to use this script to add AI security patrols via this script and a āTask_Patrolā statement - but failed big time. Anyone have an idea on how to get the AI to spawn but instead of it being at random when entering zone, its exact when entering the zone, and patrolling?
which map was it, just curious if i have the same issue
Disable all custom maps and check if I had ballas MLO
is there a way to add another animals type on another location ?
I try copy paste line 3 to 65, doesnāt work
If possible; i would like to spawn one ped per exact coordinate (x, y, z, heading) with the ability to make them aggressive, and have different walk styles. Also, If the ability to make them spawn again after they were all killed were possibleā¦ This would be literally the perfect animals and ped script.
Hereās an example of some different walk styles. Iām not sure how to implement any of these things personally, and iāve tried implementing code from other scripts only for it to completely break the script because itās either (A, Not made for it or (B, iām not placing the code in the right place or somethingā¦
local walks = {
āmove_m@drunk@verydrunkā,
āmove_m@drunk@moderatedrunkā,
āmove_m@drunk@aā,
āanim_group_move_ballisticā,
āmove_lester_CaneUpā,
Iāve also come to realize i have to restart the script every time i want my peds to spawn as well.
Same here, did you find a solution? Once spawned and deleted, they dont respawn
I believe you have to leave the area and come back to it
Nope. Tried that. Even though, it would not be a great solution.
what zone is the island
any way to keep animals spawning but totally remove npc peds?
Hi, how do we put coordinates in place of a zone? Thank you
so how would this look if I made it for a a_c_mtlion? please and thanks
Hello! A lot of folks seem to be having issues with animals still not spawning. I had that too and I commented out the table.insert and table.remove commands. NOTE: I have a Qbcore Framework.
local entities = {}
Citizen.CreateThread(function()
while true do
Wait(250000)
local player = GetPlayerPed(-1)
local pos = GetEntityCoords(player,1)
local ground = ground
if (IsEntityInZone(player, āCMSWā)āThese are the zones animals spawn in, to find more zones search google for int GET_ZONE_FROM_NAME_ID
or IsEntityInZone(player, āMTCHILā)
or IsEntityInZone(player, āMTGORDOā)
or IsEntityInZone(player, āMTJOSEā)
or IsEntityInZone(player, āPALFORā)
or IsEntityInZone(player, āPALHIGHā)
or IsEntityInZone(player, āSANCHIAā)
or IsEntityInZone(player, āTONGVAHā)
or IsEntityInZone(player, āPALHIGHā))
and #entities < 2 thenāhow many animals to spawn
RequestModel(āa_c_deerā) --model of animal, this is a deer (OBVIOUSLY xD).
while not HasModelLoaded(āa_c_deerā) or not HasCollisionForModelLoaded(āa_c_deerā) do
Wait(1000)
end
posX = pos.x+math.random(-100,100)
posY = pos.y+math.random(-100,100)
Z = pos.z+999.0
heading = math.random(0,359)+.0
ground,posZ = GetGroundZFor_3dCoord(posX+.0,posY+.0,Z,1)
if(ground) then
ped = CreatePed(28, āa_c_deerā, posX, posY, posZ, heading, true, true)
SetEntityAsMissionEntity(ped, true, true)
TaskWanderStandard(ped, 10.0, 10)
SetModelAsNoLongerNeeded(ped)
SetPedAsNoLongerNeeded(ped) ā despawn when player no longer in the area
ā table.insert(entities,ped)
local blip = AddBlipForEntity(ped)
SetBlipSprite(blip,103) --if you want the animals to have blips change the 0 to a different blip number
SetBlipColour(blip,0)
BeginTextCommandSetBlipName(āSTRINGā)
AddTextComponentString(āspawned entityā)
EndTextCommandSetBlipName(blip)
end
end
for i, ped in pairs(entities) do
if IsEntityInWater(ped) then --if the animal spawns in water it will auto delete
local model = GetEntityModel(ped)
SetEntityAsNoLongerNeeded(ped)
SetModelAsNoLongerNeeded(model)
DeleteEntity(ped)
ā table.remove(entities,i)
end
end
end
end)
soā¦ what was the MLO?
My zone is CMSW and the all the animals are spawning on the road not on the forest. Someone knows what to do ?