Character
Defined in: server/api.d.ts:2934
A server-placed character (vendor, ghost, house-elf, the Sorting Hat) rendered the same on every client. No AI, no owner, no health. It stands where it was placed, or walks a path the server authors (moveAlong, or follow after another entity), which every client plays on the server clock. Assigning position teleports it.
Extends
Section titled “Extends”ServerEntity.ServerEntity
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Character(
id):Character
Defined in: server/api.d.ts:2939
Wraps a character entity id without spawning it.
Parameters
Section titled “Parameters”number
Network id of the server entity to wrap.
Returns
Section titled “Returns”Character
Methods
Section titled “Methods”clearProp()
Section titled “clearProp()”clearProp():
void
Defined in: server/api.d.ts:3024
Takes the prop out of this character’s hand, on every client.
Returns
Section titled “Returns”void
destroy()
Section titled “destroy()”destroy():
boolean
Defined in: server/api.d.ts:2999
Destroys this character entity.
Returns
Section titled “Returns”boolean
equipProp()
Section titled “equipProp()”equipProp(
path,options?):void
Defined in: server/api.d.ts:3106
Attaches a mesh to a socket of this character’s body, replacing the prop it held, the way player.equipProp does for a player; every client shows it, players who arrive later included. Humans, ghosts, goblins, house-elves, busts and the T3 looks share the biped skeleton: WandSocket, SKT_RightHandSocket, SKT_LeftHandSocket, prop_hand_r_SKT and prop_hand_l_SKT. A centaur has none of those, but its hand bones SKT_RightHand and SKT_LeftHand take a prop; the hat and the Howler have no hands. A socket the body lacks leaves the prop at its origin. The default socket is the wand’s, so take the wand away or name another. Throws a RangeError for a path that is not an asset path.
Parameters
Section titled “Parameters”string
A StaticMesh or SkeletalMesh asset path.
options?
Section titled “options?”socket defaults to “WandSocket” (the right hand); offset is relative to it, scale defaults 1.
offset?
Section titled “offset?”{ pitch?: number; roll?: number; scale?: number; x?: number; y?: number; yaw?: number; z?: number; }
offset.pitch?
Section titled “offset.pitch?”number
offset.roll?
Section titled “offset.roll?”number
offset.scale?
Section titled “offset.scale?”number
offset.x?
Section titled “offset.x?”number
offset.y?
Section titled “offset.y?”number
offset.yaw?
Section titled “offset.yaw?”number
offset.z?
Section titled “offset.z?”number
socket?
Section titled “socket?”string
Returns
Section titled “Returns”void
follow()
Section titled “follow()”follow(
target,options?):boolean
Defined in: server/api.d.ts:3085
Walks after the target until stop() or a new command, replacing any path (characterMoveEnded “replaced”): one straight leg at a time to distanceCm short of it, re-laid as it moves on. It rests inside distanceCm, facing the target, and walks again once the target pulls 100 cm past it. While the target is in another virtual world, on a broom or on a flying mount it waits where it is; past teleportBeyond the server puts it beside the target. Legs are straight lines, so keeping them clear of walls is the script’s job. characterMoveEnded “targetGone” when the target leaves. False when the character is gone; throws on a target that is not a live entity, bad options, or a body Character.isMovable refuses.
Parameters
Section titled “Parameters”target
Section titled “target”Player | Character | Beast | NPC
Whom to follow; not this character.
options?
Section titled “options?”Gait or speed, distanceCm (100..3000, default 200), teleportBeyond in metres (default 60, 0 never), ground and turn rate.
Returns
Section titled “Returns”boolean
moveAlong()
Section titled “moveAlong()”moveAlong(
waypoints,options?):boolean
Defined in: server/api.d.ts:3069
Walks from where the character stands now through the waypoints, replacing any path (characterMoveEnded “replaced”). False when the character is gone; throws on bad input or on a body Character.isMovable refuses.
Parameters
Section titled “Parameters”waypoints
Section titled “waypoints”1..64 points, z a player’s origin as in Character.create.
options?
Section titled “options?”Gait or speed, loop, ground and turn rate.
Returns
Section titled “Returns”boolean
moveTo()
Section titled “moveTo()”moveTo(
x,y?,z?,options?):boolean
Defined in: server/api.d.ts:3078
moveAlong with one point.
Parameters
Section titled “Parameters”number | Vector3Like
World X (cm).
number
World Y (cm).
number
A player’s origin Z (cm).
options?
Section titled “options?”Gait or speed, ground and turn rate.
Returns
Section titled “Returns”boolean
pause()
Section titled “pause()”pause():
void
Defined in: server/api.d.ts:3009
Freezes the path or follow where it is; its clock and its events stop until resume.
Returns
Section titled “Returns”void
playClip()
Section titled “playClip()”playClip(
clipPath,options?):boolean
Defined in: server/api.d.ts:3092
Plays an AnimSequence on this character on every client, the way LocalPlayer.playClip plays one on the player, replacing the clip it plays. Every client samples it at the server clock, so they show the same frame and a player who arrives later joins it there; a one-shot without hold that has already ended is not replayed for them. A new path (moveAlong or moveTo) ends it, since its pose holds the whole body. Character.canPlayClip says which bodies can, and the clip must be for the human skeleton (the Hu_ clips are); a body whose skeleton the clip does not fit keeps its idle. False when the character is gone; throws on a path that is not an asset path, a rate out of range, or a body that cannot play clips.
Parameters
Section titled “Parameters”clipPath
Section titled “clipPath”string
An AnimSequence asset path, e.g. ‘/Game/Animation/Human/Hu_Crouch_RF_Idle_anm.Hu_Crouch_RF_Idle_anm’.
options?
Section titled “options?”loop and hold default true; hold (a one-shot keeps its last frame) applies only when loop is false; rate 0.01..10, default 1.
boolean
boolean
number
Returns
Section titled “Returns”boolean
resume()
Section titled “resume()”resume():
void
Defined in: server/api.d.ts:3014
Continues a paused path or follow from the same spot.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world,map?):void
Defined in: server/api.d.ts:3113
Moves this entity into another virtual world, within a map: there it meets the players in the same world of the same map, so world N of a dungeon is one instance of it.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
string
The map it is in, as player.location().areaId names it; “Overland” or “” for the shared map. Left out, it stays in its current map.
Returns
Section titled “Returns”void
setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: shared.d.ts:82
Restricts replication to one player’s connection, within the usual range and visibility checks; null lifts it.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Returns
Section titled “Returns”void
setWand()
Section titled “setWand()”setWand(
shown,style?):void
Defined in: server/api.d.ts:3099
Puts a wand in this character’s right hand (its WandSocket) or takes it away, on every client. Throws on a style that is not a row key, and on showing one on a body Character.canHoldWand refuses.
Parameters
Section titled “Parameters”boolean
true puts a wand in the right hand, false takes it away.
style?
Section titled “style?”string
A DT_CustomWandStyle row (e.g. ‘T003_M01_H007_M02’); omitted, the plain base wand (T000_M00).
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: server/api.d.ts:3004
Ends the path or follow (characterMoveEnded “stopped”) and stands where it is.
Returns
Section titled “Returns”void
stopClip()
Section titled “stopClip()”stopClip():
void
Defined in: server/api.d.ts:3019
Ends the clip on every client; the body goes back to its idle.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: shared.d.ts:74
Returns
Section titled “Returns”string
canHoldWand()
Section titled “canHoldWand()”
staticcanHoldWand(characterId):boolean
Defined in: server/api.d.ts:3062
Whether a character built from this id can hold a wand (setWand): false for the centaurs, the Sorting Hat and the Howler, which have no WandSocket.
Parameters
Section titled “Parameters”characterId
Section titled “characterId”string
Registry character id to test.
Returns
Section titled “Returns”boolean
canPlayClip()
Section titled “canPlayClip()”
staticcanPlayClip(characterId):boolean
Defined in: server/api.d.ts:3056
Whether a character built from this id can playClip: true for the human ids and for the ghosts, goblins, house-elves and T3 looks, which share the human skeleton; false for the centaurs (another skeleton), the busts, the Sorting Hat and the Howler.
Parameters
Section titled “Parameters”characterId
Section titled “characterId”string
Registry character id to test.
Returns
Section titled “Returns”boolean
create()
Section titled “create()”
staticcreate(key,characterId,opts):Character|undefined
Defined in: server/api.d.ts:3032
Creates or replaces an interest-streamed character, standing at the given spot until a path moves it. With look, a human id’s body wears that look instead of the id’s own, as a player’s body does: gender, face, hair, gear, hood, body sliders and a visual scale, and a full scale on top of scale. Throws on a look player.setLook would refuse (INVALID_APPEARANCE), on one with no preset or no gear, and on a look for a non-human id, which builds the game’s own class.
Parameters
Section titled “Parameters”string
Stable string key; creating again replaces the entity.
characterId
Section titled “characterId”string
Registry character id (e.g. ‘GerboldOllivander’, ‘SortingHat’). Throws if not in the built-in list.
Placement, nameplate, prompt and look options.
Returns
Section titled “Returns”Character | undefined
destroy()
Section titled “destroy()”
staticdestroy(key):boolean
Defined in: server/api.d.ts:3038
Destroys the character stored under a stable key.
Parameters
Section titled “Parameters”string
Stable key passed to create.
Returns
Section titled “Returns”boolean
isAllowed()
Section titled “isAllowed()”
staticisAllowed(characterId):boolean
Defined in: server/api.d.ts:3044
Whether Character.create accepts a registry character id: the built-in human list, plus the ghosts, house-elves, goblins, busts, T3 crowd looks and centaurs with a look of their own, the Sorting Hat and the Howler.
Parameters
Section titled “Parameters”characterId
Section titled “characterId”string
Registry character id to test.
Returns
Section titled “Returns”boolean
isMovable()
Section titled “isMovable()”
staticisMovable(characterId):boolean
Defined in: server/api.d.ts:3050
Whether a character built from this id can walk a path: false for the Sorting Hat, the Howler and the busts, which have no walk.
Parameters
Section titled “Parameters”characterId
Section titled “characterId”string
Registry character id to test.
Returns
Section titled “Returns”boolean
Properties
Section titled “Properties”characterId
Section titled “characterId”
readonlycharacterId:string
Defined in: server/api.d.ts:2954
Registry character id this character is built from.
readonlyclip: {hold:boolean;loop:boolean;path:string;rate:number; } |null
Defined in: server/api.d.ts:2969
The clip playClip set, or null. A one-shot without hold that has ended still reads here until stopClip or a new path.
readonlyid:number
Defined in: shared.d.ts:65
Network id, stable for the entity’s lifetime.
readonlylabel:string
Defined in: server/api.d.ts:2959
Nameplate text, or empty.
readonlylook:LookJson|null
Defined in: server/api.d.ts:2984
The look Character.create dressed it in, sanitized as player.setLook sanitizes one; null when it wears its registry id’s own.
movement
Section titled “movement”
readonlymovement:CharacterMovementState
Defined in: server/api.d.ts:2979
The running command: mode “path” while one runs (walking, waiting or paused) or “follow” while it follows, the waypoint it walks to or waits at, the lap, and the followed entity’s id (0 otherwise).
position
Section titled “position”position:
Vector3
Defined in: shared.d.ts:67
World position. Read, call set(...), then assign back.
readonlyprop: {offset: {pitch:number;roll:number;scale:number;x:number;y:number;yaw:number;z:number; };path:string;socket:string; } |null
Defined in: server/api.d.ts:2974
The prop equipProp attached, or null.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: shared.d.ts:69
Reads as a quaternion; assignments also accept Euler angles in degrees.
readonlyscale:number
Defined in: server/api.d.ts:2964
Uniform actor scale.
readonlystate:StateBag
Defined in: shared.d.ts:71
This entity’s key/value state: the server writes it, and every client that can see the entity receives it. See StateBag.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:2994
The virtual world scripts put this entity in. Outside the shared map (Overland) replication combines it with the entity’s map, as it does a player’s.
readonlywand:boolean
Defined in: server/api.d.ts:2944
Whether this character holds a wand (see setWand).
wandStyle
Section titled “wandStyle”
readonlywandStyle:string
Defined in: server/api.d.ts:2949
The DT_CustomWandStyle row setWand named; empty when it named none (the plain base wand, T000_M00) or there is no wand.
waypoints
Section titled “waypoints”
readonlywaypoints:CharacterWaypoint[]
Defined in: server/api.d.ts:2989
The running path’s points as given (speed resolved from gait); empty when idle or following.