You’ve probably noticed that all objects have a field in them for a script. Scripts are small pieces of code that can be placed inside of objects that allows them to perform special actions.
Examples of scripts usage include making an object move (such as a door opening), an object that gives off sounds (such as a buzzing light), or making an object hurt the player when it is equipped.
The script called main starts itself in the beginning of the game. This is used to start and stop other global scripts.
Other object Ids can be used in scripting to set and get the values of local variables from other objects in the world. You can also run functions on these object references.