An easily configurable ped spawner for fivem servers. Supports animations as well if you have the patience to find one you like.
Installation:
Place the file into the resources folder for your server.
Add ‘ensure ped_spawner’ to your server.cfg
Enjoy!
Configuration Options:
Config.Invincible: Makes the peds invincible.
Config.Frozen: Makes the peds unable to move.
Config.Stoic: Makes the peds unaware of their surroundings.
Config.MinusOne: If you need to subtract 1 from your Z-Axis coordinates when you grab them, set this to true. If you set it to false, all the default peds need to be adjusted.
Config.Distance: The distance you want peds to be spawned/deleted at.
Config.Fade: Allows peds to fade into/out of existence, rather than just popping in. The spawning process with this doesn’t catch the eye as much.
Usage:
To add another ped, just add a new line to the end of the config.
Hey, thanks for the heads up! I’m very new to coding for fivem and I appreciate the helpful feedback.
I’ve added a function to delete the peds if the player gets far enough away. It probably isn’t the best solution, as I threw it together during lunch, but hey, it works.
@MooMooMoo I created a pull request to fix a couple issues with the resource, including spawning multiple peds that qualify for the distance check. This is an absolute must-have for anyone using targets.
Hi, I am new to this whole coding thing. I am struggling to understand what is needed for this to work?? I just want to spawn a NPC behind the counter… but can’t get it to work… please help?
So I added all the banks, 24/7 stores, gas stations and ammunations as well as 2-3 other spots and for some reason I can’t get some of them to spawn. I’m not sure if it’s the ped hash or something, but it seems like the script can’t handle more then a certain number of NPC spawns? I know that sounds odd as theres nothing really doing this, but yeah even when I changed all of the banks to one ped that way spawning, sometimes they just don’t appear or one does.
Hi is there a script out there same as this but with props instead of peds? Not wanting an ingame menu. I like this design so would be awesome to use props like the peds in this script