> For the complete documentation index, see [llms.txt](https://docs.sansar.com/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sansar.com/latest/creating-in-sansar/working-with-scripts/working-with-scripts.md).

# Working With Scripts

## Working with scripts

Scripts add interactive behaviors to objects in an experience. In Sansar, you can create, upload and add your own scripts in C#.

Script API documentation

For more information on creating scripts for Sansar, read our [API Documentation](https://help.sansar.com/hc/en-us/articles/115003373967).

Alternatively, you may also find the API Documentation within the Sansar program folder. You can find the documentation on your system using the following file path: **Program Files** > **Sansar** > **Client** > **Script API > Documentation**.

To stay updated on the latest Script API changes, see [Script API updates](https://help.sansar.com/hc/en-us/articles/360000128046).

### Uploading scripts

If you are interested in uploading scripts written in C# (.cs) to your inventory from your computer, see [Uploading items in Sansar](/latest/creating-in-sansar/creatortools/importing-items.md) for a step-by-step guide on the upload process. Note that you will receive a warning if your script makes use of one of the [Restricted APIs](https://help.sansar.com/hc/en-us/articles/115004436447-Restricted-APIs).

Adding a script to an object

You can add scripts to objects in order to make them perform actions or interact with avatars and the environment. Currently, there are two ways to add a script to an object in a scene. For more information on these two ways, see [Adding scripts to an object](https://help.sansar.com/hc/en-us/articles/115003107143).

**Note:** As of October 31, 2017, objects do *not* need to be set to IsDynamic in order to trigger collision events. Additionally, animated objects may trigger collision events if their animation causes them to collide with another object or avatar.

Setting the script's parameters

Some scripts allow you to enter parameters to modify the way the script works. Each script is unique, so the name and function of parameters for each script may be different based on how it was defined by the script writer. For more information on setting a script's parameters, see [Setting script parameters](https://help.sansar.com/hc/en-us/articles/115003128103).

### Standard scripts and example scripts

We have provided several example scripts in the Sansar client's install folder for you to use. You can find the example scripts by following the file path: **Program Files** > **Sansar** > **Client** > **Script API** > **Examples**.

You can also find some documentation (and some download links) for some of these example scripts at [Example Scripts in Sansar](https://help.sansar.com/hc/en-us/articles/115003909388).

### Integrate the Sansar Script APIs into Visual Studio

To help you get started with scripting in Sansar, we have provided a project file, *ScriptExamples.csproj*, in the install folder which imports all of Sansar's APIs and example scripts into Visual Studio. It is located located in the Sansar install folder: **Program Files** > **Sansar** > **Client** > **Script API** > **Examples**. Simply open the folder in Visual Studio 2015 and the project will import the APIs and example scripts.

#### Have more questions? Ask in our [Discord!](http://discord.gg/sansarofficial)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sansar.com/latest/creating-in-sansar/working-with-scripts/working-with-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
