Getting_started/Two_scripting_environments

Server scriptsClient scripts
Runs onThe 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 asclient="0"client="1" (downloaded to players on join)
Used forGame 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.
AuthorityThe 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 librariesstring, math, blob and io (dofile, file, blobs).string and math only. No file or network access.
Entity valuesVector/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