Docs
Scripting Basics
How to write Atlas Lua — server truth, client request.
Mental model
- Client asks.
- Server validates.
- Server mutates money / items / jobs / spawn.
- Client receives the result and plays FX / UI.
Never trust the client for amounts, item names, or privileged coords.
Import
lua
shared_script '@atlas_core/imports.lua'Atlas is available on both sides. Money, inventory, jobs, and permissions that mutate state are server-only.
Wait for ready
lua
if not Atlas.IsReady() then
return
endOr poll once at boot in a thread (see Creating a Resource).
Read player / character
lua
-- server
local player = Atlas.Players.Get(source)
local character = Atlas.Characters.Get(source)
if not character then
return
endReturned tables are snapshots — safe to read, not live references to internal state.
Permissions
lua
if not Atlas.Permissions.Has(source, 'atlas.admin.health') then
return
endWire ACE in permissions.cfg. Prefer least privilege.
Atlas