> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Script API Reference

Lua script execution environment




Services for game-specific specifications.

Scripts can be executed by triggering various events within GS2.
For example, an account initialization script can be executed by triggering the event when an account is registered.
A player level-up event can trigger a script to restore stamina, for example.
Scripts can be used to extend functionality when game specifications cannot be realized with standard GS2 functionality.

The language used to write scripts is Lua.
Lua is a lightweight scripting language with a strong track record in the game industry, with simple syntax and high execution performance.

Scripts can be registered either by directly uploading a string, or by retrieving files via integration with a GitHub repository.
By using GitHub integration, you can manage script change history in Git and operate with pull request-based review.

Script execution has a time limit set by default, and overly long scripts result in errors.
Script execution time is included in the response and tallied as execution cost.

Exceptions raised within a script propagate as exceptions of the entire API call. If an exception occurs in a pre-processing script, the GS2 standard processing is not executed.

From within a script, you can call the APIs provided by GS2 directly.
You can assemble logic that spans multiple microservices inside a script, such as checking the item count in GS2-Inventory before performing GS2-Account processing, or looking at the remaining amount in GS2-Stamina to determine whether a GS2-Mission has been completed.

[Introduction to Microservices / GS2-Script](../../microservices/script)



- [GS2-Script Deploy/CDK Reference](/api_reference/script/deploy/)
  
- [GS2-Script SDK API Reference](/api_reference/script/sdk/)
  
- [GS2-Script Transaction Actions](/api_reference/script/stamp_sheet/)
  
