N.spawn — Server Entity Spawner
`N.spawn()` is the universal creator in NurJS. It lets you spawn any entity — vehicles, objects, NPCs (peds), or map blips — using one simple, unified function. Each entity type has its own suppor
🔹 Basic Syntax
const entity = N.spawn(type, data);type
string
Entity type — "vehicle", "object", "npc", or "blip".
data
object
Configuration parameters for the chosen entity type.
⚙️ Supported Types
🚗 Vehicle
Creates a new vehicle and sets its parameters automatically.
N.spawn("vehicle", {
model: "kuruma",
pos: new mp.Vector3(215.5, -810.2, 30.7),
heading: 90,
color: [111, 111, 255],
plate: "NURJS",
engine: true,
lock: false,
owner: player, // optional: player reference or name
fuel: 100,
setmodes: { 11: 3, 22: 2 } // vehicle mods
});✅ Features:
Auto-assigns
veh.NurID(unique UUID).Supports
variablesandsetmodes.Saves spawn data (
pos,heading,dimension).Logs creation in console if
debugis enabled.Sends notify to owner if available.
model
string
Vehicle model name.
pos
Vector3
Spawn position.
heading
number
Rotation heading in degrees.
color
array
[primary, secondary] colors.
dimension
number
Dimension ID (default 0).
owner
object / string
Owner info (player, name, or dbid).
plate
string
Custom number plate text.
lock
boolean
Locked state.
engine
boolean
Engine on/off.
fuel
number
Starting fuel level.
vehid
number
Internal random ID.
variables
object
Custom synced variables.
setmodes
object
Vehicle modification dictionary.
📦 Object
Creates a synced world object.
✅ Features:
Fully synchronized object with rotation and variables.
Automatically assigned
NurIDand spawn data.
model
string
Object model name.
pos
Vector3
Position vector.
rot
Vector3
Rotation angles.
dimension
number
Dimension ID.
dynamic
boolean
Whether object is dynamic (true by default).
variables
object
Custom synced variables for players.
🧍 NPC / Ped
Spawns a non-player character.
✅ Features:
NPC automatically freezes if
freeze: true.Can play scenarios like sitting, smoking, guarding, etc.
Automatically synced variables and
NurID.
model
string
Ped model name.
pos
Vector3
Position vector.
heading
number
Heading rotation.
dimension
number
Dimension ID.
freeze
boolean
Freeze NPC movement.
scenario
string
GTA scenario string.
variables
object
Synced variables.
🗺️ Blip
Creates a map blip visible to all players.
✅ Features:
Adds an icon to the player map.
Automatically generates
NurIDfor internal tracking.
name
string
Blip label text.
pos
Vector3
Map position.
sprite
number
Blip icon ID.
color
number
Color index.
shortRange
boolean
Whether visible only nearby.
scale
number
Blip size (default 1.0).
🧠 Debug Mode
If N.config.debug = true, every spawn action prints a detailed message:
N.spawn() unifies all entity creation in one function —
vehicles, NPCs, objects, and blips — all with consistent syntax and automatic synchronization.
It simplifies spawning logic and keeps your code clean, readable, and universal.
Last updated