Skip to content

An advanced NPC management system for FiveM servers. This resource allows you to create and manage both static and dynamic NPCs with customizable behaviors, animations, combat settings, and routes.

Notifications You must be signed in to change notification settings

CodeWizardsDev/wizard-npcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Wizard NPCs

A comprehensive NPC management system for FiveM servers. This resource allows you to create and manage both static and dynamic NPCs with customizable behaviors, animations, combat settings, and patrol routes.

📝 Table of Contents

🚀 Features Scope

  • Static and dynamic NPC creation
  • Customizable NPC behaviors and attributes
  • Support for animations and scenarios
  • Weapon handling and combat behavior configuration
  • Patrol route system with waypoints
  • Relationship management (friendly/hostile NPCs)
  • Dynamic prop attachment system with bone support
  • Route-specific prop and animation changes
  • Point-specific behavior configuration

🏁 Getting Started

  1. Download the resource
  2. Place it in your server's resources directory
  3. Add ensure wizard-npcs to your server.cfg
  4. Configure the NPCs in the config.lua file
  5. Restart your server

⚙️ Configuration

Default Settings

The Config.DefaultSettings table in config.lua contains default values that will be used if not specified in individual NPC configurations:

Config.DefaultSettings = {
    model = "a_m_y_business_01",      -- Default ped model
    invincible = true,                -- NPC damage immunity
    isCop = false,                    -- Law enforcement status
    accuracy = 80,                    -- Shooting accuracy (0-100)
    combatAbility = 2,                -- Combat skill (0: Poor, 1: Average, 2: Professional)
    combatRange = 1                   -- Combat distance (0: Near, 1: Medium, 2: Far)
}

NPC Configuration

NPCs are configured in the Config.NPCs table. Only options with (*) are required. all others are optional and can be removed if not needed. Each NPC can have the following properties:

{
    model = "a_m_y_business_03",      -- (*) Ped model name
    coords = vector4(x, y, z, h),     -- (*) Position and heading
    scenario = "SCENARIO_NAME",        -- Animation scenario
    static = true,                     -- Static position
    isCop = true,                     -- Law enforcement status
    weapon = "WEAPON_NAME",           -- Weapon hash name
    isEnemy = false,                  -- Hostile status
    invincible = true,               -- Damage immunity
    accuracy = 90,                    -- Shooting accuracy
    combatAbility = 2,               -- Combat skill level
    combatRange = 1,                 -- Combat range
    attachProp = {                   -- Attached prop configuration
        name = "prop_name",          -- Prop model name
        bone = 28422,                -- Attachment bone ID
        rotation = vector3(0.0, 0.0, 0.0), -- Prop rotation
        offest = vector3(0.0, 0.0, 0.0)   -- Prop position offset
    },
    animation = {                     -- Custom animation
        dict = "animation_dict",
        name = "animation_name"
    },
    route = {                         -- Patrol route
        {
            loc = vector4(x, y, z, h),    -- Route point coordinates
            animation = {                  -- Point-specific animation
                dict = "animation_dict",
                name = "animation_name",
                duration = 5000           -- Animation duration in ms
            },
            attachProp = {               -- Point-specific prop to attach to player bone
                name = "prop_name",
                bone = 28422,      -- right hand
                rotation = vector3(0.0, 0.0, 0.0),
                offest = vector3(0.0, 0.0, 0.0)
            },
            run = true,                  -- Run to this point
            waitTime = 2000              -- Wait time at point in ms (No need if you have animation in the route)
        }
    }
}

🛠️ Example Configuration

Config.NPCs = {
    {
        model = "a_m_y_business_03",
        coords = vector4(221.75, -808.21, 29.68, 331.46),
        scenario = "WORLD_HUMAN_CLIPBOARD",
        static = true,
        isCop = true,
    },
    {
        model = "a_m_y_business_01",
        coords = vector4(234.5, -782.1, 29.68, 165.2),
        weapon = "WEAPON_PISTOL",
        isEnemy = false,
        invincible = true,
        accuracy = 90,
        combatAbility = 2,
        combatRange = 1,
    }
}

📞 Support

✍️ Authors

  • @The_Hs5

About

An advanced NPC management system for FiveM servers. This resource allows you to create and manage both static and dynamic NPCs with customizable behaviors, animations, combat settings, and routes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages