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.
📚 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.
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.
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.
The avatar in a hidden state is not visible, but it is possible to connect the video and audio.
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)
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.
Even after closing the app and restarting it, the stored values will not disappear.
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
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.
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