Read a value
const visits = save.get("visits")
if visits == nil {
save.set("visits", 1)
} else {
save.set("visits", visits + 1)
}
save.commit()
A missing key returns nil.
Commit changes
save.set() and save.remove() change values in memory. Call save.commit() to write them to disk. A failed commit reports an error.
Supported values
Save numbers, booleans, and strings. Baskets, maps, functions, and object handles are not supported save values. Save data belongs to the project and uses one default slot. It does not change the saved World or script files. See the Save API for exact calls.