Skip to content

Get Sansar

Scripting

Stats Example

Example Script: Stats Example

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

The example script, Stats Example (StatsExample.cs), can provide useful statistics about the current experience. Grab the file from the download link at the end of the page.

Instructions

Here is a step-by-step guide to using the script:

  1. Download the script file from the download link at the end of this article.
  2. Follow the instructions provided in Working with scripts to upload the script and add it to an object.
  3. Since this script has no special parameters to set, your script is ready. Save and build your scene.
  4. If you want to verify if the script is running correctly, visit the built scene.
  5. While visiting the scene, open the Chat app.
  6. In the chat field, enter one of the commands listed below in order to get the desired information.
CommandReturned result
/helpProvides information about the other commands.
/fireCauses you to fire a cannonball.
/xpinfoProvides information about the current experience, including name, IDs, and more.
/listagentsLists all agents currently in the scene.
/myposTells you your current position within the scene.

Creative Commons License

Have more questions? Email help@sansar.com.