Skip to content

player: members

86 implemented, 16 reserved. Entries are sorted by name.

player.account: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The account name of the player. Read-only.

echo(player.account);

Specification: world-and-objects.md§4.1.

player.addtab(tab: object) -> number

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

On the rc player of an RC session: shows an RCTab next to RC Chat in that session. Returns 1, or 0 when that session has ended. Adding a name again updates its readonly value.

function onRemoteControlLogin(rc) {
temp.t = new RCTab("Log");
rc.addtab(temp.t);
}

Specification: rc-and-rights.md§10.7.

player.addweapon(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Gives the weapon to this player. Returns 1 when added, 0 when the player already had it; a weapon that does not exist reports R-NO-SUCH-WEAPON.

pl.addweapon("Bow");

Specification: world-and-objects.md§7.1.

player.ani: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The gani the player is playing.

echo(player.ani);

Specification: world-and-objects.md§4.1.

player.attached: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True when the player rides along with an NPC on this client.

echo(player.attached);

Specification: player-api.md§5.4.

player.attachplayertoobj(player: number, npc: any) -> boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Makes the local player ride along with an NPC, given as an object or an id, keeping the offset it has now. The first argument is the player index; only 0, the local player, can be attached. Returns true when it worked. On the server it acts on the player the call is made on (player.attachplayertoobj()) or the player in scope, and that player’s client does it.

attachplayertoobj(0, findnpc("Lift"));

Specification: player-api.md§5.4.

player.attr: array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The attribute strings of the player, attr[1] to attr[30], drawn by the gani slots ATTR1 to ATTR30 (attr[1] is the hat). Server and client both write them; a client change to the local player is sent to the server and shown to the other players.

player.attr[1] = "hat0.png";

Specification: player-api.md§4.1a.

player.bodyimg: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The body image.

echo(player.bodyimg);

Specification: world-and-objects.md§4.1.

player.cancelevents(event: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Cancels the scheduled events of that name on this player.

pl.cancelevents("onLater");

Specification: world-and-objects.md§9.3.

player.chat: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The text shown over the head.

echo(player.chat);

Specification: world-and-objects.md§4.1.

player.chatoffset: string

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The pixel offset of the chat bubble and emoticon of this player as dx, dy; kept on this client only.

player.chatoffset = {0, -8};

Specification: player-api.md§4.5.

player.colors: array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The five body colors as palette indexes.

echo(player.colors);

Specification: world-and-objects.md§4.1.

player.communityname: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The community name of the player. Read-only.

echo(player.communityname);

Specification: world-and-objects.md§4.1.

player.defaultwalkspeed: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The speed of the default controller; 0.5 by default, at most 2.

player.defaultwalkspeed = 0.75;

Specification: player-api.md§2.3.

player.detachplayer()

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Ends riding along with an NPC. On the server it acts on the player the call is made on (player.detachplayer()) or the player in scope, and that player’s client does it.

detachplayer();

Specification: player-api.md§5.4.

player.diagonalwalkspeed: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Extra factor on the speed when both axes move; 1 by default, at most 2.

player.diagonalwalkspeed = 0.7071;

Specification: player-api.md§2.3.

player.dir: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The direction: 0 up, 1 left, 2 down, 3 right.

echo(player.dir);

Specification: world-and-objects.md§4.1.

player.emoticon: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The image shown over the head of the player for a few seconds. It is replicated.

echo(player.emoticon);

Specification: player-api.md§6.1.

player.freezeplayer(seconds: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Freezes the local player for the given number of seconds: it cannot walk or use weapons. On the server it acts on the player the call is made on (player.freezeplayer()) or the player in scope, and that player’s client does it.

freezeplayer(2);

Specification: world-and-objects.md§11.5.

player.freezeplayer2()

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Freezes the local player until unfreezeplayer is called. On the server it acts on the player the call is made on (player.freezeplayer2()) or the player in scope, and that player’s client does it.

freezeplayer2();

Specification: world-and-objects.md§11.5.

player.freezetime: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The seconds left of a freeze. Writing it freezes the player for that long, at most 3600.

player.freezetime = 2;

Specification: player-api.md§2.4.

player.gmapx: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The x position in world tiles on a gmap. Read-only.

echo(player.gmapx);

Specification: world-and-objects.md§4.1.

player.gmapy: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The y position in world tiles on a gmap. Read-only.

echo(player.gmapy);

Specification: world-and-objects.md§4.1.

player.guild: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The guild tag.

echo(player.guild);

Specification: world-and-objects.md§4.1.

player.hasweapon(name: string) -> number

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

1 when this player has the weapon (names compare without case).

if (pl.hasweapon("Bow")) echo("armed");

Specification: world-and-objects.md§7.1.

player.head: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The head image; the same as headimg.

echo(player.head);

Specification: player-api.md§4.2.

player.headimg: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The head image.

echo(player.headimg);

Specification: world-and-objects.md§4.1.

player.headset: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The number in the head image name head.png, or 0. Writing it picks that head image on this client.

echo(player.headset);

Specification: player-api.md§4.2.

player.hideemoticon()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Removes the emoticon over the local player’s head.

player.hideemoticon();

Specification: player-api.md§6.1.

player.hidesign()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Closes the sign box when the local player is reading.

player.hidesign();

Specification: player-api.md§6.2.

player.horseimg: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The image of the horse the player rides; empty for none. It is replicated.

player.horseimg = "horse.png";

Specification: player-api.md§2.6.

player.id: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The id of the player in this session. Read-only.

echo(player.id);

Specification: world-and-objects.md§4.1.

player.ipaddresshash: string

Runs on: server only. Origin: compatibility. Since: M12. Playground: no. read-only.

A text of 32 hex digits that identifies the address the player connected from. The server keys the hash with a secret, so the address cannot be recovered from it; the same address gives the same text while the server keeps its secret.

echo(player.ipaddresshash);

Specification: player-api.md§5.1.

player.isadmin: boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no. read-only.

True for a staff account.

echo(player.isadmin);

Specification: player-api.md§5.1.

player.isblocking: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Whether the local player is stopped by this player; set on this client only.

echo(player.isblocking);

Specification: player-api.md§4.5.

player.isbuddy: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Whether this player counts as a friend; kept on this client only.

echo(player.isbuddy);

Specification: player-api.md§4.5.

player.iscarrying: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

1 while the player carries something.

echo(player.iscarrying);

Specification: world-and-objects.md§4.1.

player.isignored: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Whether this player is muted; kept on this client only.

echo(player.isignored);

Specification: player-api.md§4.5.

player.isignoring: boolean

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

Whether the player ignores you; always false, Borne does not tell a client who ignores it.

echo(player.isignoring);

Specification: player-api.md§4.8.

player.isinclass(className: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

1 when this player joined the class.

if (pl.isinclass("shop")) echo(1);

Specification: world-and-objects.md§6.

player.isjumping: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while the player plays the jump gani.

echo(player.isjumping);

Specification: player-api.md§2.1.

player.isloggedin: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True for every player the client sees.

echo(player.isloggedin);

Specification: player-api.md§5.1.

player.isobserver: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: there is no observer mode.

echo(player.isobserver);

Specification: player-api.md§2.1.

player.isrc: number

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

1 while the account is logged in to the RC (the player is then also in allplayers, and level reads empty when the account is not playing), 0 otherwise. Read only.

if (sender.isrc) echo("staff");

Specification: rc-and-rights.md§10.7.

player.join(className: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Adds the functions of the class to this player; on a player the join lasts until logout.

pl.join("shop");

Specification: world-and-objects.md§6.

player.language: string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

The language the player chose in the preferences.

echo(player.language);

Specification: player-api.md§4.8.

player.languagedomain: string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

The language domain; empty, Borne has none.

echo(player.languagedomain);

Specification: player-api.md§4.8.

player.leave(className: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Takes the functions of a joined class away from this player.

pl.leave("shop");

Specification: world-and-objects.md§6.

player.letters: string

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

A string the script stores on the local player.

player.letters = "abc";

Specification: player-api.md§2.9.

player.level: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The name of the level the player is in. Warps change it. Read-only.

echo(player.level);

Specification: world-and-objects.md§4.1.

player.levelname: string

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The level the player is in, even before its data arrived.

echo(player.levelname);

Specification: player-api.md§5.1.

player.map: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no built-in map.

echo(player.map);

Specification: player-api.md§2.1.

player.mapicon: string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The mini-map icon. It is kept for scripts that write it; Borne draws no legacy mini-map.

player.mapicon = "";

Specification: player-api.md§4.8.

player.nick: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The nickname shown below the player to the other players; the player sees their own only for 3 seconds after typing showname or setnick <nick> in the chat.

echo(player.nick);

Specification: world-and-objects.md§4.1.

player.offline: boolean

Runs on: server only. Origin: engine extension. Since: M12. Playground: no. read-only.

True for a TServerPlayer of an account that is not online (a temporary copy), false for an online player.

temp.p = new TServerPlayer(acct);
if (temp.p.offline) temp.p.save();

Specification: world-and-objects.md§4.8.

player.onhorse: boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no. read-only.

True when the player has a horse image.

echo(player.onhorse);

Specification: player-api.md§2.1.

player.online: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while the client is connected to a server.

echo(player.online);

Specification: player-api.md§2.1.

player.paused: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

When true the default controller stops the player. For another player it is a flag kept on this client only.

player.paused = true;

Specification: player-api.md§2.4.

player.platform: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no. read-only.

The system the client of the player runs on: linux, windows, macos or other.

echo(player.platform);

Specification: player-api.md§4.7.

player.playerlisticon: number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The player list icon, 0 to 63. It is replicated through the player list.

echo(player.playerlisticon);

Specification: player-api.md§4.6.

player.playersindex: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The position of the player in the player list, or -1.

echo(player.playersindex);

Specification: player-api.md§5.1.

player.reading: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while the sign box is open.

echo(player.reading);

Specification: player-api.md§2.1.

player.removeweapon(name: string) -> number

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Takes the weapon from this player. Returns 1 when it was removed.

pl.removeweapon("Bow");

Specification: world-and-objects.md§7.1.

player.say2(text: string)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Shows a message in the sign box. On the server it acts on the player the call is made on (player.say2()) or the player in scope, and that player’s client does it.

say2("Welcome!");

Specification: world-and-objects.md§11.5.

player.scheduleevent(delay: number, event: string, ...args?: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Raises the event on this player after the delay in seconds.

pl.scheduleevent(2, "onLater", 1);

Specification: world-and-objects.md§9.3.

player.scrollsign(steps: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Steps through the sign text. The sign box has no pages, so 0 does nothing and any other number closes the current message.

player.scrollsign(1);

Specification: player-api.md§6.2.

player.sendping() -> object

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Pings the client of the player and returns a request object. When the client answers, the object raises onReceivePing(time) with the round trip in milliseconds (also stored in its time field); use this.catchevent(request, “onReceivePing”, “callback”) or define function request.onReceivePing(time). At most 16 pings may wait for one player.

temp.req = player.sendping(); this.catchevent(temp.req, "onReceivePing", "onPong");

Specification: player-api.md§5.1.

player.sendrpgmessage(text: string)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Writes the text to the script log, like trace. On the server it acts on the player the call is made on (player.sendrpgmessage()) or the player in scope, and that player’s client does it.

sendrpgmessage("hello");

Specification: player-api.md§9.5.

player.setani(ani: string, params: string)

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Plays the animation on this player, with its comma-separated parameters.

pl.setani("idle", "");

Specification: world-and-objects.md§11.

player.setcharani(ani: string, param: string) -> any

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Like setani, for the character look of this player.

pl.setcharani("walk", "");

Specification: world-and-objects.md§11.

player.shield: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The shield image; the same as shieldimg.

echo(player.shield);

Specification: player-api.md§4.2.

player.shieldimg: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The shield image.

echo(player.shieldimg);

Specification: world-and-objects.md§4.1.

player.showemoticon(file: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Shows an image over the local player’s head for a few seconds and tells the other players. An empty name hides it.

player.showemoticon("emoticon-a.png");

Specification: player-api.md§6.1.

player.showemoticonbykey(key: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Shows the emoticon that belongs to a key, given as a key code or a one-letter string. Keys that are not letters or digits do nothing.

player.showemoticonbykey(getascii("a"));

Specification: player-api.md§6.1.

player.swimming: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while the feet are on water.

echo(player.swimming);

Specification: player-api.md§2.1.

player.sword: string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

The sword image; the same as swordimg.

echo(player.sword);

Specification: player-api.md§4.2.

player.swordimg: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The sword image.

echo(player.swordimg);

Specification: world-and-objects.md§4.1.

player.trigger(event: string, ...args?: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Raises the event on this player at once and returns what the handler returned.

pl.trigger("onHello", 1);

Specification: world-and-objects.md§9.3.

player.triggerclient(type: string, name: string, ...args?: any) -> any

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

Sends a trigger to the client of this player (the legacy method form of triggerclient).

temp.pl.triggerclient("gui", this.name, "ping");

Specification: networking.md§7.3.

player.unfreezeplayer()

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Lets a frozen local player move again. On the server it acts on the player the call is made on (player.unfreezeplayer()) or the player in scope, and that player’s client does it.

unfreezeplayer();

Specification: world-and-objects.md§11.5.

player.weapon: weapon

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The selected weapon as an object, or empty.

echo(player.weapon);

Specification: player-api.md§2.7.

player.weapons: weapon[]

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The owned weapons as an array of objects.

echo(player.weapons);

Specification: player-api.md§2.7.

player.x: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The x position in tiles, relative to the level.

echo(player.x);

Specification: world-and-objects.md§4.1.

player.y: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The y position in tiles, relative to the level.

echo(player.y);

Specification: world-and-objects.md§4.1.

player.z: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The height in tiles.

echo(player.z);

Specification: world-and-objects.md§4.1.

player.zoomfactor: number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The zoom factor of the legacy zoom keys. It is kept for scripts but the camera does not use it.

player.zoomfactor = 1;

Specification: player-api.md§4.8.

These names exist so that older scripts compile. Calling one reports R-NOT-IMPLEMENTED and does nothing else.

Name Signature Runs on
fullhearts player.fullhearts() -> any client only (not yet verified)
getnohit player.getnohit(arg1: string) -> any client only (not yet verified)
hp player.hp() -> any client only (not yet verified)
isfemale player.isfemale() -> any client only (not yet verified)
isguildpm player.isguildpm() -> any client only (not yet verified)
ismale player.ismale() -> any client only (not yet verified)
ismasspm player.ismasspm() -> any client only (not yet verified)
maxhp player.maxhp() -> any client only (not yet verified)
openexternalhistory player.openexternalhistory() -> any client only (not yet verified)
openexternalpm player.openexternalpm(arg1: boolean) -> any client only (not yet verified)
pmswaiting player.pmswaiting() -> any client only (not yet verified)
rating player.rating() -> any client only (not yet verified)
ratingd player.ratingd() -> any client only (not yet verified)
sendtoirc player.sendtoirc(arg1: string, arg2: string) -> any client only (not yet verified)
seturllevel player.seturllevel(url: any) -> any server only (not yet verified)
showProfile player.showProfile(x: any) -> any client only (not yet verified)

Engine version 0.1.0. Built 2026-11-18.