Counter Strike Online Wiki
Advertisement
Script caller.png
NOTE: This is an English version of the Lua API Documentation for CSO (South Korean).

The Documentation has not been released yet for other languages like English, so we did the translation of it into unofficial so that all can understand how it works.

Modules

Module Description
Common This module contains functionality for scripts that run together on both the client and server.
Game This module contains functions for scripts running on the server.
UI This module contains functionality for scripts running on the client.

Classes

Class Description
Common.WeaponOption Weapon Options Object
Game.Entity Player and Monster parent objects
Game.EntityBlock Studio Device Blocks
Game.Rule Game rule object
Game.Monster Monster object
Game.Player Player object
Game.SyncValue Variables automatically synchronized to the client
Game.Weapon Weapon object
UI.SyncValue Variables automatically synchronized with the server
UI.Box Rectangle UI screen draws a specific rectangle.
UI.Event UI event callback
UI.Text Draw a specific string on the text UI screen

Examples of Codes

Image Map Reference Game Mode Example Script
Scenariot.png
Trail & Sewer Scenario T (Based on Zombie Scenario) Scenario T Example
Hottdeath.png
Can be played on Any Studio Maps that have the Script Loaded and has the Play Mode is Studio play mode Team Deathmatch Team Deathmatch Example

Saving and Loading data

1. Data
Data is stored in specific groups of each creator. Creators can designate their map as a specific group, or deactivate the save function by excluding them from the group. Maps specified as a group have data saving and retrieval functions enabled.
2. Group Data and Player Data
There are two types of data: group data shared by all maps in that group regardless of a specific player, and player data used by each player in that group .
  • Group data are Game.Rule:SetGameSave can be added or changed using the function.
  • Player data is Game.Player:SetGameSave can be added or changed using the function.
3. Save and Load
Group data is automatically loaded when the game starts, and is automatically saved every minute or when the game ends.
Player data can be retrieved after the first spawn by pressing the L key. If the player doesn't load the data, it is automatically saved after 1 minute or at the end and overwritten with new data.
4. Basic Data
Player data automatically stores and recalls some information. The data and names saved by default are as follows.
"health": Player's current health
"maxhealth": Player's maximum health
"armor": the player's current armor
"maxarmor": Player's maximum armor
"coin": Player's studio coin
"items": player's studio items
The above data is used automatically, so it cannot be used as the name of Game.Player:SetGameSave function. But you can check the saved value with Game.Player:GetGameSave function.

Changelog

1.5
  • Add common module
  • Add WeaponOption class
  • Add Entity class
  • Monster class added
  • Add Weapon class
  • Move some of the functions of the Player class to the Entity class
  • Added camera-related functions to the Player class
  • Player class UI related functions added to Player class
  • Added weapon-related features to the Player class
  • Add event callbacks to Rule class
  • Add UI.Signal
  • UI.Event: OnKeyDown added
  • UI.Event: OnKeyUp added
1.4
  • Add game save API
1.3
  • New Zombie Aksha added to player model type
  • Fixed typos in UI.SyncValue.value
1.2
  • Round start event callback added
  • Fixed an issue where the script restarts when the next round starts after calling the team and player win functions
1.1
  • Added player team change feature
  • Added a function to change the stiffness when hitting the player
  • Added the ability to change the knockback value when the player is hit
  • Added player model change function
  • Added an event callback where the player is being attacked
  • Added weapon type and attack area parameters to Game.Rule: OnPlayerKilled
  • Add function to get own player index in UI script
  • Add a function that gets its properties to the UI object
  • Add a function to activate the device control script block
  • Added function to operate a function with a specific name with a function call script block
  • Fixed Game.Player: Respawn not working in Game.Rule: OnPlayerKilled
  • Added game end factor to team and player win functions
  • Added functions to get the current game time (Game.GetTime (), UI.GetTime ())
1.0
  • Studio script release

External Links

Official Lua API Documentation page for CSO/CSN:S (In Korean)


Advertisement