Field

Introduction

These are the attribute values pertaining to players.

The playerโ€™s nickname (name), location (tileX / tileY), etc. can be viewed. The playerโ€™s spotlight (spotlight) feature and hide (hidden) feature can be activated. The playerโ€™s movement speed (moveSpeed) and image (sprite) can be adjusted. Itโ€™s also possible to utilize the Space's storage (storage) for storing player values.

๐Ÿ”’ Fields with this icon are read-only fields that cannot be revised.

Name
Description

๐Ÿ”’ id

Player ID value

name

Player Nickname value

title

Text to be displayed in yellow above an avatarโ€™s nickname

๐Ÿ”’ role

A numerical value that represents a playerโ€™s permissions

๐Ÿ”’ tileX / tileY

The X and Y coordinate values where the avatar is standing

๐Ÿ”’ dir

A value representing the direction a player is looking

moveSpeed

A value representing the playerโ€™s movement speed

sprite

An avatarโ€™s sprite image value

tag

Value storage space to assign required attribute values

hidden

If the value is set to true, the player is invisible

spotlight

Toggle player spotlight

๐Ÿ”’ disableVideo

Toggle player video

๐Ÿ”’ disableAudio

Toggle player audio

attackType

Playerโ€™s attack type when z is pressed

attackSprite

Playerโ€™s attack image value when z is pressed

attackParam1

Distance value that affects how far the attack image flies

attackParam2

Distance value available for attack Only valid when attackType is set to 2 (ranged attack)

๐Ÿ”’ walletAddress

The playerโ€™s wallet address value

storage

Storage space for player values in the Space (limited to the Space)

๐Ÿ”’ isMobile

Whether the player is connected via mobile

๐Ÿ”’ isMoving

If the player is moving, returns True. If not, returns False

๐Ÿ”’ isJumping

If the player is jumping, returns True. If not, returns False

customData

Can read the URL query string and save the value

displayRatio

Zoom in or out player's display

titleColor

Player's title color

๐Ÿ”’ emailHash

The hash value of the player's email

๐Ÿ”’ isGuest

If the player is not signed in, returns True.

๐Ÿ“š API Description and Examples

id , name

player.id: Number player.name: String

Calls the player ID and nickname values.

Example

Make the playerโ€™s ID and nickname value display when a player enters.

title

player.title: String

Title is a yellow text that displays above the avatarโ€™s nickname.

Example

Set up a title for a player when they enter.

role

player.role: Number

Role is the playerโ€™s permission rolesโ€™ number value.

The following values will be displayed depending on the playerโ€™s role.

Role
Number
Role
Number

Guest

-1

Staff

2000

Member

0

Admin

3000

Editor

1000

Owner

3001

Example

Display the permission role value in the chat screen.

tileX, tileY

player.tileX: Number player.tileY: Number

The x axis value and y axis value of where the playerโ€™s avatar is standing.

Example

Display my avatarโ€™s x and y coordinates.

dir

player.dir: Number

The direction the playerโ€™s avatar is looking.

The following values are displayed depending on the direction the avatar is looking.

Direction
Number
Direction
Number

Left

1

Top-Left

5

Up

2

Bottom-Left

6

Right

3

Top-Right

7

Down

4

Bottom-Right

8

Example

Display the value of where the avatar is looking.

moveSpeed

player.moveSpeed: Number

This is the playerโ€™s movement speed value. (Default Value: 80)

If the movement speed value is 0, the player cannot move.

Example

Increase the movement speed when q is pressed.

sprite

player.sprite: ScriptDynamicResource

A sprite image of the playerโ€™s avatar. (Resets to the default avatar image when inputting null)

Check the Understanding Sprite Sheets page if itโ€™s your first time hearing about sprite images.

Example

Apply the Paintman-Blueman image as the avatar image.

tag

player.tag: Any

Give necessary attribute values to a player by using tag.

Example

Give a player the โ€˜aliveโ€™ attribute value. The โ€˜aliveโ€™ attribute value is a deliberately created attribute.

If the attribute is unused, it wonโ€™t be a useful attribute value. In this case, the "alive" attribute value can check if a player has been eliminated from a game or not.

hidden

player.hidden: Boolean

If the hidden attribute value is true, the corresponding player is not visible to other players.

Example

Give an avatar the hidden attribute to make the avatar not visible to other players.

spotlight

player.spotlight: Boolean

This activates or deactivates the playerโ€™s spotlight feature.

Example

Make a function that turns the spotlight feature ON or OFF by pressing q.

disableVideo, disableAudio

player.disableVideo: Boolean player.disableAudio: Boolean

This activates or deactivates the playerโ€™s video/audio features.

Example

Display in the chat screen if the video and/or audio are deactivated or not.

attackType

player.attackType: Number

This is a playerโ€™s attack type performed by pressing z. (default value: 0)

attackType
Description

0

If the attackType is not set up, it means it is set to the default attack type.

Example

Change the avatarโ€™s attackType.

attackParam1

player.attackParam1: Number

This is an attribute for the attack imageโ€™s distance range shown when pressing z. The attackโ€™s possible distance range does not increase.

Example

Change the attackParam1.

attackParam2

player.attackParam2: Number

This is an attribute for distance available for attack. This is only valid when attackType is set to a ranged attack.

Example

Set a ranged attack using attackParam2.

attackSprite

player.attackSprite: ScriptDynamicResource

This is an attribute for the attack image shown when pressing z.

Example

Apply the boxing gameโ€™s glove attack image.

walletAddress

player.walletAddress: String

This is the playerโ€™s wallet address.

Example

Call the wallet address. If there is no wallet address, the results called will be null.

storage

player.storage: String

This is the storage space for the player value within the space. (Limited to the Space)

Example

Store the data in player storage and check it.

isMobile

player.isMobile : Boolean

This displays whether the player is connected via mobile in true or false.

Example

Display mobile PC status in the entry message when a player enters.

isMoving

player.isMoving : Boolean

If the player is moving, this function returns True. If not, this returns False.

Example

Detect the player's movement and display a message.

isJumping

player.isJumping : Boolean

If the player is jumping, this function returns True. If not, this returns False.

Example

Detect the player's movement and display a message.

customData

player.customData : String

This field saves the value received as a query string.

Example

How to Use URL Query Strings

displayRatio

player.displayRatio

This function zooms the player's display in or out. (Default Value: 1)

Example

Create a key to zoom in or out.

displayRatio = 1
displayRatio = 5

titleColor

player.titleColor

This function can read and change the player title's color.

You can enter enum values or hex code values.

Example

Change the title color.

emailHash

player.emailHash

This function reads the hash value of the player's email.

Example

Display the hash value of a player.

isGuest

player.isGuest

If the player is not signed in, this function returns True.

Example

Show "GUEST" as a title when a guest who is not signed in enters.

Last updated

Was this helpful?