Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Runtime classServer APIGenerated

Player

Defined in: server/api.d.ts:655

A connected player and the character they control. Their own game decides their body: what a getter reads is their last report, and a setter is a request their game carries out, then reports back.

new Player(id): Player

Defined in: server/api.d.ts:660

Wraps an already connected player with this ID; it neither connects nor spawns anyone.

number

Network entity identifier.

Player

BasePlayer.constructor

addBounty(faction, amount, violent?): boolean

Defined in: server/api.d.ts:1322

Adds to the bounty a player owes a crime faction, as Papyrus Faction.ModCrimeGold does; a negative amount pays part of it off.

string | number

A TESFaction form ID, as a number or hex string.

number

How much to add, -1,000,000 to 1,000,000; never below 0 in all.

boolean

The violent part (assault, murder), which the game’s guards answer by attacking; the non-violent one (theft, trespass) when false or left out.

boolean

True when sent; false when the player is gone.


addPerk(perk, withLowerRanks?): boolean

Defined in: server/api.d.ts:1217

Gives the character a perk rank without spending a point.

string | number

A BGSPerk rank.

boolean

Also give the ranks below it; true when left out.

boolean

True when the record changed; false before the character is established. Throws for a form ID that is no perk.


addXp(amount): boolean

Defined in: server/api.d.ts:1183

Awards experience as the game does: each level it reaches brings a perk point and the game’s level-up.

number

More than 0. Not scaled by Intelligence.

boolean

True when the record changed; false before the character is established.


damageValue(value, amount): boolean

Defined in: server/api.d.ts:1134

Lowers an actor value’s current value in the player’s game, as ObjectReference.DamageValue does. Health damaged to 0 kills.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number

How much, at least 0. Rads rise by it.

boolean

True when sent; false when the player is gone.


discoverLocations(markers, canTravel?): boolean

Defined in: server/api.d.ts:1362

Puts map markers on the player’s map, as ObjectReference.AddToMap does, without its notice. The map is their game’s own: the server keeps no copy, so send it again when they join.

(string | number)[]

Map marker references, each a form ID as a number or hex string; up to 4096.

boolean

Also fast travel destinations (default true); false shows them on the map only.

boolean

True when sent; false when the player is gone.


emit(eventName, payloadJson?): void

Defined in: server/api.d.ts:4387

Emits a named script event to this player’s client connection.

string

Client event name.

string

Optional JSON payload forwarded verbatim to the owning client.

void

BasePlayer.emit


enterPowerArmor(frame?): boolean

Defined in: server/api.d.ts:865

Places a power armor frame where the player stands and puts them into it at once, as Actor.SwitchToPowerArmor does. playerPowerArmor follows. The suit’s pieces are the frame’s; dress them with setOutfit.

string | number

The TESFurniture of the frame to place; the game’s empty frame when left out.

boolean

True when sent; false when the player is gone or already in power armor.


equipItem(form): boolean

Defined in: server/api.d.ts:996

Has the player draw a weapon or wear an armor piece they carry. Right after giveItem it lands too: the inventory reaches their game first.

string | number

A weapon or armor piece the player carries.

boolean

True when sent; false when the server’s record has none of it or the player is gone.


exitPowerArmor(): boolean

Defined in: server/api.d.ts:781

Takes the player out of their power armor; the frame stays where they stand. playerPowerArmor follows once their game is done, which it is not while they fly the fly camera (NoClip): the game leaves the player’s own update alone until the camera comes back.

boolean

True when sent; false when the player is gone or not in power armor.


fastTravel(destination): boolean

Defined in: server/api.d.ts:1335

Has the player’s game fast travel to a reference, through the game’s own fast travel, as Game.FastTravel does. playerFastTravel is not raised: the script decided already.

string | number

The reference to arrive at: a map marker, or any other placed reference.

boolean

True when sent; false when the player is gone.


fire(shots?): boolean

Defined in: server/api.d.ts:830

Has the player’s game fire its drawn weapon.

number

How many times, 1 to 255; once when left out.

boolean

True when sent; false when the player is gone.


forgetLocations(markers): boolean

Defined in: server/api.d.ts:1369

Takes map markers off the player’s map; they stop being fast travel destinations.

(string | number)[]

Map marker references, each a form ID as a number or hex string; up to 4096.

boolean

True when sent; false when the player is gone.


getAppearance(): string | null

Defined in: server/api.d.ts:932

The player’s whole look as their game last reported it, as an opaque string to keep (a database column) and hand back to setAppearance.

string | null

Null before their first report or once they are gone.


getBaseValue(value): number | null

Defined in: server/api.d.ts:1118

The base the character’s record holds for an actor value: SPECIAL, Experience, and any base a script set.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number | null

The base; null for one the record does not hold.


getBounty(faction): number

Defined in: server/api.d.ts:1304

The bounty the player owes a crime faction, as FiveM’s wanted level reads: the crime gold their game says they owe it, violent and not together. Their own crimes raise it as the game’s do, theft and assault the faction’s members witness; setBounty and addBounty change it. playerBountyChange follows every change.

string | number

A TESFaction form ID, as a number or hex string.

number

The crime gold; 0 when they owe none or are gone.


getCaps(): number

Defined in: server/api.d.ts:1230

The bottle caps the player carries: the Caps001 item in the inventory record.

number

The count; 0 before the first inventory report or once they are gone.


getCharacter(): CharacterDocument | null

Defined in: server/api.d.ts:1255

The whole character: experience, level, perk points, bases, perks, current values and inventory. Keep it wherever the gamemode likes; setCharacter takes it back.

CharacterDocument | null

The document; null before the character is established.


getDamageModifier(): number

Defined in: server/api.d.ts:1047

What setDamageModifier scales the player’s hits by.

number

The modifier; 1 when none was set.


getDefenseModifier(): number

Defined in: server/api.d.ts:1060

What setDefenseModifier scales the hits on the player by.

number

The modifier; 1 when none was set.


getFactionRank(faction): number | null

Defined in: server/api.d.ts:1282

The player’s rank in a faction the server put them in.

string | number

A TESFaction form ID, as a number or hex string.

number | null

The rank; null when the server did not put them in it.


getFactions(): object[]

Defined in: server/api.d.ts:1275

The factions the server put the player in, each with its rank. The factions their character holds from the game’s own data, such as PlayerFaction, are not listed.

object[]

One entry per faction, in the order they were joined; empty when the player is gone.


getIdleTime(): number

Defined in: server/api.d.ts:1002

How long the player has neither moved nor turned their view, in seconds, as the server measures it from what their game reports: what an AFK check reads.

number

0 for one who is moving or looking around, or who is gone.


getInventory(): InventoryItem[]

Defined in: server/api.d.ts:952

What the player carries, from the server’s record.

InventoryItem[]

One entry per base object and condition; empty before the player’s first report, shortly after they join, and once they are gone.


getIP(): string

Defined in: server/api.d.ts:4393

Returns this player’s current remote network address.

string

Address string, or an empty string when the player or peer is unavailable.

BasePlayer.getIP


getItemCount(form): number

Defined in: server/api.d.ts:959

How many of an item the player carries.

string | number

The base object.

number

The count; 0 when they carry none or are gone.


getLevel(): number

Defined in: server/api.d.ts:1156

The character’s level.

number

The level; 0 when the player is gone.


getLocation(): number | null

Defined in: server/api.d.ts:1341

The named location the player is in, a BGSLocation form ID, as their game last reported it.

number | null

Null in the open, before their first report, or when the player is gone.


getMapWaypoint(): Vector3 | null

Defined in: server/api.d.ts:1347

Where the player’s own map marker is: the waypoint they dropped on the Pip-Boy map, or the one a script set.

Vector3 | null

The position, in the space they stood in; null while they have none or when the player is gone.


getNametagColor(): number

Defined in: server/api.d.ts:4374

Reads this player’s nametag color.

number

Packed 0xAARRGGBB color; opaque white when untinted.

BasePlayer.getNametagColor


getNametagText(): string

Defined in: server/api.d.ts:4368

Reads this player’s nametag text override.

string

The override, or an empty string when the player’s own name is drawn.

BasePlayer.getNametagText


getOutfit(): OutfitPiece[]

Defined in: server/api.d.ts:896

What the player wears.

OutfitPiece[]

One entry per armor piece; empty when the player is gone.


getPerkPoints(): number

Defined in: server/api.d.ts:1189

The character’s unspent perk points.

number

The points; 0 when the player is gone.


getPerks(): number[]

Defined in: server/api.d.ts:1202

The perk ranks the character holds. Each rank of a perk is a BGSPerk of its own.

number[]

Their form IDs; empty when the player is gone.


getPowerArmor(): PlayerPowerArmor | null

Defined in: server/api.d.ts:878

The power armor frame the player wears.

PlayerPowerArmor | null

The frame, or null when they wear none or are gone.


getSpace(): PlayerSpace | null

Defined in: server/api.d.ts:884

Where the player is.

PlayerSpace | null

The worldspace or interior cell, or null when the player is gone.


getValue(value): number | null

Defined in: server/api.d.ts:1111

An actor value as it stands: Health, ActionPoints and Rads as the player’s game last reported them, any other the base the record holds.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number | null

The value; null before the character is established or for a value the record does not hold.


getWeapon(): PlayerWeapon | null

Defined in: server/api.d.ts:890

The weapon in the player’s hands.

PlayerWeapon | null

The weapon, or null when they have none or are gone.


getWeather(): number | null

Defined in: server/api.d.ts:1412

The weather setWeather gave the player alone.

number | null

Null while they follow World.weather, or once they are gone.


getWeatherRegion(): number

Defined in: server/api.d.ts:1424

The region whose weathers the player’s game would roll where they stand, as their game finds it each time they change cell: the TESRegion form ID, for World.getRegionWeathers.

number

0 when they stand in no region with weathers, or their game has not said yet.


getXp(): number

Defined in: server/api.d.ts:1169

The character’s total experience.

number

The XP; 0 when the player is gone.


giveItem(form, count?, condition?, mods?, name?): boolean

Defined in: server/api.d.ts:970

Puts items in the player’s inventory. It does not equip them: see equipItem.

string | number

The base object.

number

How many, 1 to 1000000; one when left out.

number

Their condition in percent of full, 0 to 100, as one stack: a fusion core’s charge. Full when left out.

number[]

The OMOD form IDs they carry, as setItemMods takes them; the mods their record gives a new one when left out.

string | null

The name they show, as setItemName gives it; their own when left out.

boolean

True when the record changed; false before the player’s first report or once they are gone.


hasPerk(perk): boolean

Defined in: server/api.d.ts:1209

Whether the character holds a perk rank.

string | number

A BGSPerk rank.

boolean

True when they hold it. Throws for a form ID that is no perk.


isNametagHealthVisible(): boolean

Defined in: server/api.d.ts:4362

Checks whether the health bar under this player’s nametag is shown.

boolean

True unless the health bar was hidden; false also when this game has no nametags.

BasePlayer.isNametagHealthVisible


isNametagVisible(): boolean

Defined in: server/api.d.ts:4356

Checks whether this player’s nametag is shown to other players.

boolean

True unless the nametag was hidden; false also when this game has no nametags.

BasePlayer.isNametagVisible


kick(reason?): void

Defined in: server/api.d.ts:4380

Disconnects this player from the server.

string

Optional reason shown to the disconnected player; omitting it uses the generic kicked reason.

void

BasePlayer.kick


kill(): boolean

Defined in: server/api.d.ts:787

Kills the player through their game’s own hit path; playerDeath follows with a null killer.

boolean

True when sent; false when the player is gone or already dead.


knockDown(force?, from?): boolean

Defined in: server/api.d.ts:1075

Knocks the player off their feet into their ragdoll from the server, as FiveM’s SetPedToRagdoll does a player’s ped: their game pushes them, as LocalPlayer.knockDown does, they lie a moment and get up by themselves, and every other player sees them fall. A player who is down, dead, held in place or in furniture is left as they are.

number

How hard they are thrown, as ObjectReference.PushActorAway takes it: small numbers, 1 to 50 (600 threw an NPC 8,700 units); 0, the default, drops them where they stand.

Vector3

The point they are thrown away from; where they stand by default.

boolean

True when sent; false when the player is gone.


openLookEditor(): boolean

Defined in: server/api.d.ts:793

Opens the character look editor on the player’s screen.

boolean

True when sent; false when the player is gone.


openPerkChart(): boolean

Defined in: server/api.d.ts:1249

Opens the game’s perk chart on the player’s screen. Each rank bought comes back as playerPerkRequest.

boolean

True when sent; false when the player is gone.


openSpecialMenu(): boolean

Defined in: server/api.d.ts:1243

Opens the game’s SPECIAL allocation menu on the player’s screen, as the Vault 111 exit does. Each point they move comes back as playerValueRequest.

boolean

True when sent; false when the player is gone.


playIdle(idle): boolean

Defined in: server/api.d.ts:1104

Plays an idle animation on the player, as Actor.PlayIdle does; everyone around them sees it. The idle’s own conditions apply, so one meant for another skeleton, a piece of furniture or a state the player is not in does nothing. Moving ends most idles; stopIdle ends any.

string | number

An idle animation from the game’s data (an IDLE record): its editor ID, such as "Salute", or its form ID.

boolean

True when sent; false when the player is gone. Throws for a name or form ID no IDLE record has.


randomizeLook(seed?, morphsOnly?): boolean

Defined in: server/api.d.ts:926

Rolls the character a new look from their race’s character generation data.

number

Rolls the same look for the same seed; a fresh one when left out.

boolean

Only the face sliders and regions, keeping sex, hair and colours.

boolean

True when sent; false when the player is gone.


randomizeOutfit(seed?): boolean

Defined in: server/api.d.ts:911

Dresses the player in a random playable outfit, mods included.

number

Rolls the same outfit for the same seed; a fresh one when left out.

boolean

True when sent; false when the player is gone.


removeFromAllFactions(): boolean

Defined in: server/api.d.ts:1328

Takes the player out of every faction the server put them in. The factions their character holds from the game’s own data stay.

boolean

True when sent; false when the player is gone.


removeFromFaction(faction): boolean

Defined in: server/api.d.ts:1297

Takes the player out of a faction the server put them in, as Actor.RemoveFromFaction does.

string | number

A TESFaction form ID, as a number or hex string.

boolean

True when they were in it; false otherwise or when the player is gone.


removeItem(form, count?, condition?, mods?, name?): boolean

Defined in: server/api.d.ts:981

Takes items out of the player’s inventory.

string | number

The base object.

number

How many, 1 to 1000000; one when left out. More than they carry takes them all.

number

The condition to take first, 0 to 100; the rest come from the fullest stacks. Full when left out.

number[]

The mods of the ones to take, as getInventory lists them; none when left out.

string | null

The name of the ones to take; unnamed ones when left out.

boolean

True when the record changed; false before the player’s first report or once they are gone.


removePerk(perk): boolean

Defined in: server/api.d.ts:1224

Takes a perk rank from the character, and every rank above it. No point is refunded.

string | number

A BGSPerk rank.

boolean

True when the record changed; false when they do not hold it.


respawn(position?, heading?): boolean

Defined in: server/api.d.ts:823

Brings a dead player back at full health. Nothing respawns a player on its own: call this from playerDeath, at once or later.

Vector3

Where to come back; where the player fell when left out.

number

Facing in radians; the one they died with when left out.

boolean

True when sent; false when the player is gone or alive.


restoreValue(value, amount): boolean

Defined in: server/api.d.ts:1142

Raises an actor value’s current value in the player’s game up to its maximum, as ObjectReference.RestoreValue does.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number

How much, at least 0. Rads fall by it.

boolean

True when sent; false when the player is gone.


say(line): boolean

Defined in: server/api.d.ts:1067

Has the player’s character speak, voice and subtitle, as FiveM’s PlayAmbientSpeechNative does a player’s ped: their own game says it, picking a topic’s line among those whose conditions pass, and every other player’s game hears their puppet say the same line in the player voice of their sex. Lines the character says on its own, in dialogue or in a fight, are heard the same way.

string | number

A dialogue topic (DIAL) by form ID or editor ID, such as 0x1B40FA, the player’s combat lines, or one of its lines (INFO) by form ID.

boolean

True when sent; false when the player is gone. Throws for a form no DIAL or INFO record has.


setAlpha(alpha, fade?): boolean

Defined in: server/api.d.ts:1090

Draws the player more or less see-through for everyone, as FiveM’s SetEntityAlpha and SetEntityVisible do a player’s ped: their own game sets it, as LocalPlayer.setAlpha does, and every other game draws their body the same. At 0 no game shows their nametag either. An admin’s invisibility, a spectator, a spawn’s protection.

number

0, invisible, to 1, solid.

boolean

Fade there rather than cut (default false).

boolean

True when sent; false when the player is gone.


setAppearance(look): boolean

Defined in: server/api.d.ts:939

Puts a whole look back on the player: their game rebuilds them and everyone sees it. Throws for a look from another server version.

string

As getAppearance returned it on this server version.

boolean

True when sent; false when the player is gone.


setBaseValue(value, base): boolean

Defined in: server/api.d.ts:1126

Sets an actor value’s base on the record and in the player’s game, as ObjectReference.SetValue does: for Health or CarryWeight that is the maximum. It is saved with the character and set again whenever they join.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number

The new base. SPECIAL is rounded and kept within 1 to 11.

boolean

True when the record changed; false before the character is established.


setBounty(faction, amount, violent?): boolean

Defined in: server/api.d.ts:1313

Sets the bounty a player owes a crime faction, as Papyrus Faction.SetCrimeGold / SetCrimeGoldViolent and FiveM’s SetPlayerWantedLevel do: their own game records it, so the faction’s guards answer it as the game does a crime of theirs. getBounty reads the result once their game reports it.

string | number

A TESFaction form ID, as a number or hex string.

number

The new crime gold, 0 to 1,000,000; 0 clears it.

boolean

The violent part (assault, murder), which the game’s guards answer by attacking; the non-violent one (theft, trespass) when false or left out.

boolean

True when sent; false when the player is gone.


setCaps(caps): boolean

Defined in: server/api.d.ts:1237

Sets the bottle caps the player carries.

number

0 to 1000000.

boolean

True when the record changed; false before the first inventory report.


setCharacter(character): boolean

Defined in: server/api.d.ts:1262

Replaces the character with a document, and brings the player’s game to it.

Partial<CharacterDocument>

As getCharacter returns it. What it leaves out stays as it is.

boolean

True when applied; false before the character is established. Throws for a malformed document.


setClipAmmo(rounds): boolean

Defined in: server/api.d.ts:844

Loads rounds into the player’s weapon, as FiveM’s SetAmmoInClip does a ped’s. The rounds come from those they carry, as a reload takes them: never more than they have, so giveItem the ammo first. Their game ignores it without a weapon that loads ammo in hand.

number

The rounds to load, 0 to 100000; more than the weapon’s clip loads a full clip.

boolean

True when sent; false when the player is gone.


setCollision(enabled): boolean

Defined in: server/api.d.ts:851

Takes the player’s collision away or gives it back, as FiveM’s SetEntityCollision does a ped and the console’s tcl the player: without it they move along where they look, through walls and floors, without gravity. An admin’s noclip on foot; everyone else sees their body pass through. It ends with their session.

boolean

False to take their collision away, true to give it back.

boolean

True when sent; false when the player is gone.


setDamageModifier(modifier): boolean

Defined in: server/api.d.ts:1041

Scales the damage the player’s hits deal, on players and NPCs alike, as FiveM’s SetPlayerWeaponDamageModifier does. Every hit is scaled by the attacker’s modifier, the weapon’s (setWeaponDamageModifier) and the victim’s defense (setDefenseModifier) before playerHit or npcHit hears of it: their damage is what is dealt. A hit on an NPC the attacker’s own game runs is taken there at once, unscaled, and the difference is dealt or given back right after. It lasts until set again or they leave.

number

From 0 to 100: 1 for none, 0.5 for half, 2 for double, 0 for no damage at all.

boolean

True when set; false when the player is gone.


setDefenseModifier(modifier): boolean

Defined in: server/api.d.ts:1054

Scales the damage hits deal the player, from players and NPCs alike, as FiveM’s SetPlayerWeaponDefenseModifier does: 0.5 halves what they take. A hit by an NPC their own game runs is taken there at once, unscaled, and the difference is dealt or given back right after. Falls, radiation and hazards are their game’s and are not scaled. It lasts until set again or they leave.

number

From 0 to 100: 1 for none, 0.5 for half, 2 for double, 0 for no damage at all.

boolean

True when set; false when the player is gone.


setDifficulty(difficulty): boolean

Defined in: server/api.d.ts:1384

Sets the game’s difficulty for the player, as its settings menu does: how hard they hit and are hit. “survival” is the game’s Survival mode with all its rules, run by its own quest in the player’s game: hunger, thirst and sleep, illness, carry weight that hurts, no fast travel, no saving, no compass markers for unfound places. It lasts until they leave, when their game goes back to what it was; set it again for each player as they join.

"veryEasy" | "easy" | "normal" | "hard" | "veryHard" | "survival"

The game’s difficulty setting.

boolean

True when sent; false when the player is gone.


setFactionRank(faction, rank?): boolean

Defined in: server/api.d.ts:1290

Puts the player in a faction at a rank, or re-ranks them, as Actor.SetFactionRank does: their own game and every other player’s give their character the membership, so the game’s hostility follows it. NPCs of the faction and its allies treat them as one of their own; its enemies attack them. Up to 16 factions per player; whether a player’s hits on another land stays playerHit’s say.

string | number

A TESFaction form ID, as a number or hex string.

number

0 to 127; 0 when left out.

boolean

True when set; false when the player is gone or already in 16 factions.


setGameName(name): boolean

Defined in: server/api.d.ts:946

Names the player’s character in their own game, as the Vault 111 registration form does: what the game’s menus show, and what the SPECIAL menu requires before it closes. Others see the nametag, not this.

string

1 to 64 characters.

boolean

True when sent; false when the player is gone.


setGameSetting(name, value): boolean

Defined in: server/api.d.ts:1377

Changes one of the game’s own tuning values (a game setting, GMST) in the player’s game, where it takes effect at once and lasts until they leave. The server keeps no copy: to make it a rule, set it for each player as they join. A name their game has not, or a value of the wrong kind, changes nothing there.

string

The setting’s name as the game’s data defines it: “fJumpHeightMin”, “fSprintSpeedMult”.

number | boolean

The new value, of the setting’s kind: a boolean for a b setting, a number for the others.

boolean

True when sent; false when the player is gone.


setHour(hour): boolean

Defined in: server/api.d.ts:1406

Holds the player’s clock, and the sun and the sky with it, at an hour of their own until it is released. Their game’s day count and date stay the world’s. Lasts until they leave.

number | null

The hour to hold the player’s clock at, wrapped into 0-24; null to follow World.hour again.

boolean

True when sent; false when the player is gone.


setInvulnerable(invulnerable): boolean

Defined in: server/api.d.ts:1034

Makes the player unhurtable, as FiveM’s SetPlayerInvincible does: their game makes them a ghost, which shots, blows and explosions pass over, and turns on the game’s immortal mode, so a fall or radiation never takes their last point of health; the server drops every hit still reported on them, from players and NPCs, before playerHit or npcAttack. It lasts until undone or they leave.

boolean

True to make them unhurtable, false to make them hurtable again.

boolean

True when sent; false when the player is gone.


setItemCount(form, count): boolean

Defined in: server/api.d.ts:989

Sets how many of an item the player carries, over every condition: more are added at full condition, fewer are taken from full stacks first.

string | number

The base object.

number

How many the player should carry, 0 to 1000000.

boolean

True when the record changed; false before the player’s first report or once they are gone.


setItemMods(form, mods, current?): boolean

Defined in: server/api.d.ts:1011

Changes the mods on one item the player carries, as FiveM’s GiveWeaponComponentToPed and RemoveWeaponComponentFromPed do, or a workbench would: its condition stays, and the weapon in hand is taken up again with them. Mods that do not fit the item are left out by their game. The change reaches getInventory and getWeapon once their game reports it.

string | number

A weapon or armor piece the player carries.

number[]

The OMOD form IDs it should carry, all of them: a scope, a barrel, a paint. Empty gives it the mods its record gives a new one, as a weapon is never without a receiver.

number[]

The mods of the one to change, among several; the weapon in hand when left out and it is of this form, else the first one found.

boolean

True when changed, or already so; false when the player carries none that matches.


setItemName(form, name, current?): boolean

Defined in: server/api.d.ts:1020

Names one item the player carries, as a workbench’s rename does: the Pip-Boy, the trade and container menus and the HUD show the name in place of the item’s own, and it stays with the item when it is dropped, stored in a container or picked up again. How a script shows what its own systems track, such as “Pipe Pistol [73%]”. The game keeps a named item apart from the unnamed ones, and the one in hand or worn is taken up again under its new name. The change reaches getInventory once their game reports it.

string | number

The item the player carries.

string | null

The name it shows, up to 64 bytes of UTF-8 without control characters; null or empty gives it back its own.

Which one among several: each field given narrows it. The weapon in hand or the armor piece worn when left out and it is of this form, else the first one found.

number

number[]

string | null

boolean

True when changed, or already so; false when the player carries none that matches.


setLevel(level): boolean

Defined in: server/api.d.ts:1163

Sets the character’s level and their XP to the start of it. No perk points come with it: see setPerkPoints.

number

1 to 65535.

boolean

True when the record changed; false before the character is established.


setLook(look): boolean

Defined in: server/api.d.ts:918

Changes the character’s look; the player’s game rebuilds them and everyone sees it.

What to change: the sex, the skin tone in 0-255 channels, a hair BGSHeadPart. What is left out stays.

boolean

string | number

{ b: number; g: number; r: number; }

number

number

number

boolean

True when sent; false when the player is gone.


setMapWaypoint(position): boolean

Defined in: server/api.d.ts:1354

Places the player’s own map marker, which their compass and Pip-Boy map show, or takes it off. playerMapWaypoint is not raised: the script decided already.

Vector3 | null

Where to, in the space the player stands in; null takes it off.

boolean

True when sent; false when the player is gone.


setNametagColor(color): void

Defined in: server/api.d.ts:4417

Tints the text on this player’s nametag.

number

Packed 0xAARRGGBB color.

void

BasePlayer.setNametagColor


setNametagHealthVisible(visible): void

Defined in: server/api.d.ts:4405

Shows or hides the health bar under this player’s nametag, leaving the name itself alone.

boolean

True to show the health bar under this player’s name, false to hide it.

void

BasePlayer.setNametagHealthVisible


setNametagText(text?): void

Defined in: server/api.d.ts:4411

Overrides the text drawn on this player’s nametag.

string

Text to show instead of the player’s name, cut to 64 bytes; empty or omitted restores the name.

void

BasePlayer.setNametagText


setNametagVisible(visible): void

Defined in: server/api.d.ts:4399

Shows or hides the name over this player’s head for every other player. The health bar has its own switch, and each player can still hide all nametags locally.

boolean

True to show this player’s nametag to everyone, false to hide it.

void

BasePlayer.setNametagVisible


setOutfit(pieces, mode?): boolean

Defined in: server/api.d.ts:904

Dresses the player. Pieces the player’s game cannot wear are skipped there.

(string | number | { form: string | number; mods?: (string | number)[]; })[]

Armor form IDs, or objects naming the mods to attach. Up to 32 pieces of 8 mods.

"replace" | "remove" | "add"

replace, the default, wears exactly these and takes every other piece off; add puts them on over what is worn; remove takes them off.

boolean

True when sent; false when the player is gone.


setPerkPoints(points): boolean

Defined in: server/api.d.ts:1196

Sets the character’s unspent perk points.

number

0 to 255.

boolean

True when the record changed; false before the character is established.


setPowerArmorBattery(charge): boolean

Defined in: server/api.d.ts:872

Sets the charge of the fusion core in the player’s power armor, through the value their game drains. At 0 their game does what it does with an empty core: it loads the next fusion core they carry, or leaves the suit unpowered. Above the core’s capacity the capacity follows. It also lifts the hold a refused core left the suit in. playerPowerArmorBattery follows.

number

The charge to leave in the core, 0 to 1000; a full fusion core holds 100.

boolean

True when sent; false when the player is gone or not in power armor.


setRace(race): boolean

Defined in: server/api.d.ts:858

Rebuilds the player on another race, as the console’s setrace and Actor.SetRace do: a ghoul. Their skin and body become the race’s, their head parts stay their own, and every other player sees their puppet rebuilt the same way. Only human and ghoul are supported; any other race is refused. The race they had comes back with null, and when their session ends.

string | number | null

0x13746 (HumanRace) or 0xEAFB6 (GhoulRace); null for the race they had.

boolean

True when sent; false when the player is gone.


setRestrained(restrained): boolean

Defined in: server/api.d.ts:1097

Holds the player in place from the server, as FiveM’s FreezeEntityPosition does a player’s ped and Actor.SetRestrained an actor: their game keeps them standing where they are, neither moving nor acting, until let go. Cuffs, an arrest, an admin freeze, a cutscene. A player who is down or dead is left as they are.

boolean

True to hold them where they stand, false to let them go.

boolean

True when sent; false when the player is gone.


setScale(scale): boolean

Defined in: server/api.d.ts:1082

Scales the player in every game, as ObjectReference.SetScale does: their own game scales their character, and every other game their body. It lasts until set again or they leave.

number

1 for their normal size, from 0.01 to 10.

boolean

True when sent; false when the player is gone.


setValue(value, current): boolean

Defined in: server/api.d.ts:1150

Moves an actor value’s current value in the player’s game, keeping its base.

string | number

An actor value: its editor ID, such as "Strength" or "Health", or its form ID.

number

The current value to reach; no higher than the maximum.

boolean

True when sent; false when the player is gone.


setVatsRolledByServer(enabled): boolean

Defined in: server/api.d.ts:1391

Moves the roll of the player’s VATS hits to the server. Their game rolls each queued shot against the chance it shows; while this is on, every shot with a chance above 0 strikes instead, and its hit reaches playerHit or npcHit as kind “vats” with that chance: the handler rolls it (Math.random() < vatsChance) and returns false for a miss. Lasts until they leave; set it again for each player as they join.

boolean

True to roll the player’s VATS hits on the server, false to leave them to their game.

boolean

True when sent; false when the player is gone.


setVirtualWorld(world): void

Defined in: server/api.d.ts:4292

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void

BasePlayer.setVirtualWorld


setVisibleTo(player): void

Defined in: server/api.d.ts:4298

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void

BasePlayer.setVisibleTo


setWeaponDrawn(drawn): boolean

Defined in: server/api.d.ts:837

Holds the player’s weapon out or away, as FiveM’s SetCurrentPedWeapon forces a ped’s: their game draws or holsters it at once and keeps it so against their own ready-weapon key and the game’s. Away for a safe zone, out for a scripted scene. With no weapon in hand, out raises their fists. To stop attacks too, a client script turns off Controls “fighting”.

boolean | null

True to hold their weapon out, false to keep it away, null to hand it back to them.

boolean

True when sent; false when the player is gone.


setWeather(weather, force?): boolean

Defined in: server/api.d.ts:1399

Gives the player a sky of their own, over the one World holds for everyone: the weather of the worldspace they stand in, a storm over one quest, a clear sky for a cutscene. The server strikes its lightning as for the World’s. Lasts until they leave: to make it a rule, set it on playerSpaceChange, playerWeatherRegionChange or as they join.

string | number | null

A TESWeather form ID for this player alone; null to follow World.weather again.

boolean

Swap it in at once rather than transition to it.

boolean

True when sent; false when the player is gone.


setXp(xp): boolean

Defined in: server/api.d.ts:1176

Sets the character’s total experience, and their level to match. No perk points come with it.

number

The total, at least 0.

boolean

True when the record changed; false before the character is established.


stopIdle(): boolean

Defined in: server/api.d.ts:799

Stops the idle animation the player plays and returns them to their stance.

boolean

True when sent; false when the player is gone.


strikeLightning(): boolean

Defined in: server/api.d.ts:1418

Strikes lightning in the player’s sky alone: a flash and a thunderclap, if their sky is in a weather that thunders. In a session the game’s own strikes come from the server (World.setLightningEnabled).

boolean

True when sent; false when the player is gone.


teleport(position, heading?, space?, options?): boolean

Defined in: server/api.d.ts:815

Moves the player, within their space or into another one. Into an interior they land at a persistent reference inside it, as a quest script moves the player, and position is not used: wait for playerSpaceChange, then teleport them within it. playerSpaceChange follows any change of space.

Vector3

Where to, in the space the player goes to.

number

Facing in radians; the current one when left out.

Another worldspace or an interior cell, exactly one of the two; the one the player is in when left out.

string | number

string | number

loadScreen: whether the player’s game may show its loading screen when the destination is not loaded (default true). With false the destination streams in with no loading screen, as the game’s own “No Load Screen” doors do: their game stalls for the load instead, so fade the screen first (Hud.fade).

boolean

boolean

True when sent; false when the player is gone, or the interior has no reference to land at. Throws for a position that is not a finite Vector3.


toString(): string

Defined in: server/api.d.ts:805

Formats this handle for logging.

string

The player’s network ID and nickname.

BasePlayer.toString


unequipItem(form): boolean

Defined in: server/api.d.ts:1027

Has the player put a weapon away for good or take an armor piece off: they keep carrying it.

string | number

A weapon or armor piece the player carries.

boolean

True when sent; false when the server’s record has none of it or the player is gone.


static all(): Player[]

Defined in: server/api.d.ts:1453

Every connected player.

Player[]

One handle per player, in no particular order.


static getById(id): Player | null

Defined in: server/api.d.ts:1460

Looks a player up by network ID.

number

Network entity identifier.

Player | null

The handle, or null when no connected player has that ID.


static getInRange(center, radius, options?): Player[]

Defined in: server/api.d.ts:1433

The players around a point, a player or an NPC, nearest first, as FiveM scripts run GetActivePlayers through a distance check: who hears a shout, who stands in a zone, who is close enough to trade. Positions are the ones the players’ games last reported.

Vector3 | Player | Npc

A point, or a player or an NPC, whose position and space are then the search’s; a player is not counted among its own.

number

How far from it, in game units.

space: where a point is, the Commonwealth when left out. limit: how many at most, 32 by default, never more than 512.

number

{ worldSpace: number; } | { interiorCell: number; }

Player[]

Empty when nobody is in range, or the center is gone. Throws for a center that is none of these, or a negative radius.


static getWeaponDamageModifier(weapon): number

Defined in: server/api.d.ts:1447

What setWeaponDamageModifier scales the weapon’s hits by.

string | number

The weapon (WEAP).

number

The modifier; 1 when none was set.


static setWeaponDamageModifier(weapon, modifier): void

Defined in: server/api.d.ts:1440

Scales the damage every hit of a weapon deals, whoever wields it, players and NPCs alike, as FiveM’s SetWeaponDamageModifier does; it stacks with the attacker’s setDamageModifier and the victim’s setDefenseModifier. It lasts while the server runs.

string | number

The weapon (WEAP) whose hits are scaled.

number

From 0 to 100: 1 for none, which forgets it.

void


static xpForLevel(level): number

Defined in: server/api.d.ts:1269

The total experience a level starts at, by the game’s formula.

number

1 to 65535.

number

The XP.

readonly aimPitch: number

Defined in: server/api.d.ts:715

Aim pitch, in radians.


readonly armor: number

Defined in: server/api.d.ts:680

Damage resistance from the armor the player wears.


readonly discordId: string

Defined in: server/api.d.ts:4324

Authenticated Discord identifier, or an empty string when unavailable.

BasePlayer.discordId


readonly discordName: string

Defined in: server/api.d.ts:4329

Discord username the client reported, not verified by the server, or an empty string when unavailable.

BasePlayer.discordName


readonly epicId: string

Defined in: server/api.d.ts:4319

Epic Games account identifier the client reported, not verified by the server, or an empty string when unavailable.

BasePlayer.epicId


readonly hardwareId: string

Defined in: server/api.d.ts:4334

Framework hardware identifier, or an empty string when unavailable.

BasePlayer.hardwareId


readonly heading: number

Defined in: server/api.d.ts:710

Facing, in radians around Z.


health: number

Defined in: server/api.d.ts:670

Current health, as the player’s game last reported it. Assigning asks their game to move it there, as setValue("Health", value) does; it reads the new value once they report it.


readonly id: number

Defined in: server/api.d.ts:4260

Immutable network entity identifier.

BasePlayer.id


readonly ip: string

Defined in: server/api.d.ts:4344

Current remote network address, or an empty string when unavailable.

BasePlayer.ip


readonly isAiming: boolean

Defined in: server/api.d.ts:750

Whether the player aims down the sights of a drawn gun.


readonly isBleedingOut: boolean

Defined in: server/api.d.ts:695

Whether the player is in the game’s bleedout: down on the ground and alive, where a client script put them with LocalPlayer.setBleedingOut.


readonly isDead: boolean

Defined in: server/api.d.ts:700

Whether the player is dead. A dead player stays down until respawn.


readonly isFemale: boolean

Defined in: server/api.d.ts:705

Whether the character is female.


readonly isInPowerArmor: boolean

Defined in: server/api.d.ts:760

Whether the player wears a power armor frame.


readonly isInvulnerable: boolean

Defined in: server/api.d.ts:685

Whether setInvulnerable made the player unhurtable.


readonly isJetpackFiring: boolean

Defined in: server/api.d.ts:775

Whether the jetpack of the player’s power armor thrusts.


readonly isJumping: boolean

Defined in: server/api.d.ts:730

Whether the player is in the air: from a jump, a fall or their power armor jetpack.


readonly isKnockedDown: boolean

Defined in: server/api.d.ts:690

Whether the player is knocked down, alive: in their ragdoll or getting up, after a blast or a client script’s LocalPlayer.knockDown.


readonly isPipBoyOpen: boolean

Defined in: server/api.d.ts:755

Whether the player’s Pip-Boy is up.


readonly isRunning: boolean

Defined in: server/api.d.ts:740

Whether the player runs rather than walks.


readonly isSneaking: boolean

Defined in: server/api.d.ts:725

Whether the player sneaks.


readonly isSprinting: boolean

Defined in: server/api.d.ts:735

Whether the player sprints.


readonly isSwimming: boolean

Defined in: server/api.d.ts:765

Whether the player swims: in water deep enough that their game took them off their feet.


readonly isUnderwater: boolean

Defined in: server/api.d.ts:770

Whether the water reaches above the player’s neck, as their game’s IsUnderWater condition answers. A swimmer’s body often keeps it so at the surface too.


readonly isWeaponDrawn: boolean

Defined in: server/api.d.ts:745

Whether the player’s weapon is out.


readonly maxHealth: number

Defined in: server/api.d.ts:675

Health at full.


readonly nickname: string

Defined in: server/api.d.ts:665

The name the player connected with. Empty once they are gone.


readonly ping: number

Defined in: server/api.d.ts:4339

Current round-trip latency in milliseconds, or -1 when unavailable.

BasePlayer.ping


position: Vector3

Defined in: server/api.d.ts:4270

Authoritative world-space position; assignment forces replicated state.

BasePlayer.position


rotation: Vector3 | Quaternion

Defined in: server/api.d.ts:4275

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

BasePlayer.rotation


readonly state: StateBag

Defined in: server/api.d.ts:4280

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.

BasePlayer.state


readonly steamId: string

Defined in: server/api.d.ts:4314

Authenticated Steam identifier, or an empty string when unavailable.

BasePlayer.steamId


readonly velocity: Vector3

Defined in: server/api.d.ts:720

Velocity, in game units per second.


readonly virtualWorld: number

Defined in: server/api.d.ts:4265

Current virtual-world identifier.

BasePlayer.virtualWorld