Ped Manager

Sleepless Ped Manager

A FiveM ped manager for spawning local peds within distance of players and adding target/interact options to them. Uses ox_lib points for efficient distance-based spawning and despawning.

This resource is fully compatible with both ox_target and sleepless_interact for adding interaction options to managed peds.

Features

  • 🧍 Distance-Based Spawning - Peds spawn and despawn based on player proximity using ox_lib points
  • 🎬 Animations & Scenarios - Assign animations or scenarios to peds on spawn
  • 🔧 Prop Attachments - Attach props to ped bones with configurable offsets
  • 🎯 Target Integration - Built-in support for ox_target and sleepless_interact options
  • 📍 Multi-Location Support - Define multiple spawn coordinates for a single ped configuration
  • 🔄 Lifecycle Callbacks - onSpawn and onDespawn callbacks for custom logic

Dependencies

Installation

Download the Resource

Download a release (opens in a new tab) from GitHub.

Add to Server

Place the sleepless_pedmanager folder in your server's resources directory.

Configure Your Server

Add the following to your server.cfg:

ensure ox_lib
ensure sleepless_pedmanager

Quick Start

Basic Ped with Target Options

local pedPoint = exports.sleepless_pedmanager:addPed({
    model = "a_m_m_business_01",
    coords = vec4(200.0, -900.0, 30.0, 180.0),
    scenario = "WORLD_HUMAN_CLIPBOARD",
    renderDistance = 15.0,
    targetOptions = {
        {
            icon = "fas fa-comments",
            label = "Talk",
            serverEvent = "myresource:talkToNpc",
        },
    },
})

Ped with Animation and Prop

local pedPoint = exports.sleepless_pedmanager:addPed({
    model = "u_m_y_zombie_01",
    coords = vec4(-1665.45, -3143.31, 13.99, 281.13),
    renderDistance = 8.0,
    animation = {
        dict = "amb@code_human_in_bus_passenger_idles@female@tablet@idle_a",
        anim = "idle_a",
        flag = 63,
    },
    prop = {
        propModel = "prop_cs_tablet",
        bone = 28422,
        rot = vec3(0.0, 0.0, 0.03),
        pos = vec3(0.0, 0.0, 0.03),
    },
})

The addPed export returns an ox_lib point instance that you can use to manage the ped's lifecycle. See the Client Exports page for the full API reference.

Support

If you need help or have questions: