Skip to content

API > CloudVariables


CloudVariables⚓︎

Provides access to Cloud Variables. You can use cloud variables to store persistent information about the user. Generally, the values pushed to cloud variable are stored in the server. In local mode, variables are stored locally.

Members⚓︎

Static Properties⚓︎

Name Description
CloudVariables.IsEnabled Static fieldPropertyReadonly Property Is use of cloud variables enabled for this world?
CloudVariables.ServerVariables Static fieldPropertyReadonly Property The variable bank which belongs to the current server. Most of the time world level cloud variables are read-only unless the current user is server admin.
CloudVariables.UserVariables Static fieldPropertyReadonly Property The variable bank belonging to the current local user.
CloudVariables.WorldVariables Static fieldPropertyReadonly Property The variable bank belongs to the current world. Most of the time world level cloud variables are read-only unless the current user is world creator.

Static Methods⚓︎

Name Description
CloudVariables.GetScoreBoard(variableName, descending=true, skip=0, limit=INF) Static fieldMethod Get score board associated with a variable name. The score board is generated based on previously assigned variables to users. A user with an assigned variable matching the name provided included in the score board if the variable type is number. You can specify where and how much of scoreboard to retrieve by assigning skip and limit parameters.
CloudVariables.GetUserVariableSummary(variableName, subject) Static fieldMethod Returns the summary about a variable that assigned to the specified subject. The summary is generated by going through all the variables instances assigned to the subject and collecting summary information. An example of summary usage is to get the total number of golds being distributed to users in server, given that the multiple worlds in the server can give gold to player for various reasons.
CloudVariables.RequestToPublish() Static fieldMethod Create a request for client to publish the variable changes to the server as soon as possible.

Extra Detail⚓︎

Note that the cloud variables might not be available for each world. Make sure to check IsEnabled property to ensure that cloud variables are initialized.