Cart

A wagon or cart from the game's blueprints, spawned with horses in harness, for players to ride. The server stores the blueprint, location, who sits where and the top speed, and the driver's game does the driving. A seated player's body faces the seat's direction and turns with the cart, while looking around turns only the head and view.

cart.spawn()

Cart.spawn(blueprint, position, orientation, dimension)

Spawns a cart. Throws for an unknown blueprint.

cart.all()

Cart.all(dimension)

All carts, or those in one dimension.

cart.getById()

Cart.getById(id)

The cart with this network id, or null.

cart.destroyAll()

Cart.destroyAll(dimension)

Removes all carts, or those in one dimension, after letting riders off, and returns how many.

cart.blueprints()

Cart.blueprints()

The blueprints with their horse counts and seats.

cart.horseCount

horseCount

The number of horses pulling it.

cart.seats

seats

The names of its seats.

cart.driverWalks

driverWalks

Whether the driver walks beside the horses, as with a c wagon or a cart, rather than sitting at the front.

cart.driver

driver

The player in the driver's seat, or null.

cart.pace

pace

Its current movement: 'stand', 'walk', 'trot' or 'reverse'.

cart.position

position

Its location.

cart.rotation

rotation

Its rotation.

cart.maxSpeed

maxSpeed

The driver's top speed, 0 to 15, default 7. Values outside that are ignored.

cart.load

load

What the cart visibly carries: one of `loads`, or '' for nothing. Anything else throws.

cart.loads

loads

The loads this blueprint can carry: goods, goods2 and sacks for cart_b; shadyGoods, shadyGoods2 and branches for cart_a; none for others.

cart.storage

storage

The cart's storage, or null.

cart.addStorage()

addStorage()

Gives the cart a storage and returns it as a Stash. Calling it again returns the same one. Players search it with the game's prompt at the cart.

cart.removeStorage()

removeStorage()

Removes the cart's storage and its contents.

cart.seatPlayer()

seatPlayer(player, seat)

Seats a player, taking them off any other cart. Returns false if refused, and throws for an unknown seat.

cart.unseatPlayer()

unseatPlayer(player)

Lets a player off.

cart.whoSits()

whoSits(seat)

Who sits in a seat, or null.

cart.seatOf()

seatOf(player)

A player's seat, or null.

cart.teleport()

teleport(position, orientation)

Moves the cart with everyone on it.

cart.destroy()

destroy()

Removes the cart, firing cartDestroy, after letting everyone off.

cart.id

id: number

The network id.

cart.blueprint

blueprint: string

The blueprint it was spawned from.

cart.dimension

dimension: number

Its dimension.