LocalNpc

Client only. An NPC body shown only on this machine, for things a resource puts in front of its own player, such as a figure in a character creator, a guide or a preview. The server does not know about it, and no other player sees it. Without AI it stays where you put it. `ai: true` gives it the soul's brain, which a female NPC always has. A machine can have up to 64, and they end when their resource stops.

localNpc.create()

LocalNpc.create(options)

Creates a body shown only on this machine.

localNpc.all()

LocalNpc.all()

Your resource's local NPCs.

localNpc.id

id: number

Its id on this machine.

localNpc.name

name: string

Its name.

localNpc.position

position: Vector3

Its location.

localNpc.rotation

rotation: Quaternion

The direction it faces.

localNpc.appearance

appearance: object

Its character parts: { body, head, hair, beard }.

localNpc.exists

exists: boolean

False once removed.

localNpc.setPosition

setPosition: (position, rotation?) => boolean

Moves the body, and turns it if a rotation is given.

localNpc.setAppearance

setAppearance: (request) => boolean

Changes character parts of its gender, as for Npc.setAppearance.

localNpc.playAnimation

playAnimation: (fragment, options?) => boolean

Plays one of the game's animations, as for Npc.playAnimation.

localNpc.stopAnimation

stopAnimation: () => boolean

Ends what playAnimation started.

localNpc.say

say: (text, options?) => boolean

Shows the game's speech bubble over its head. '' removes it.

localNpc.remove

remove: () => void

Removes the body from this machine's world.