Getting_started/Two_scripting_environments
| Server scripts | Client scripts | |
|---|---|---|
| Runs on | The server (Windows or Linux). One shared VM for the whole server. | Every player's game. Each player runs their own private VM. |
Marked in Script.xml as | client="0" | client="1" (downloaded to players on join) |
| Used for | Game rules, spawning vehicles/pickups/objects, scores, commands, anti-cheat, saving data, deciding what happens. | Menus and HUD (GUI), drawing text in the world, keybinds, mouse input, camera effects, local sounds. Things only one player's screen cares about. |
| Authority | The server is the authority. Players cannot change server scripts. | Client scripts can be modified by the player's machine. Never trust them: every important decision must be re-checked on the server. |
| Squirrel libraries | string, math, blob and io (dofile, file, blobs). | string and math only. No file or network access. |
| Entity values | Vector/Colour class instances, handle objects. | Positions come back as plain tables {x=, y=, z=}. |
NoteClient scripts are sent to each player as the server starts and kept in memory only (never written to disk). A player who joins always runs exactly the scripts the server currently has.
Categories: Getting started