Volt

saveinstance

Saves an instance (or the game) to a file.

Syntax

saveinstance(options: table?) -> void

Parameters

ParameterTypeDescription
optionstable(Optional) Save options

Options

OptionTypeDescription
FilePathstringOutput file path
ObjectInstanceInstance to save (default: game)
ExtraInstancestableAdditional instances to include
NilInstancesbooleanInclude nil-parented instances
RemovePlayerCharactersbooleanExclude player characters
Modestring"optimized", "full", or "scripts"

Returns

This function does not return a value.

Description

saveinstance exports an instance hierarchy to an RBXL/RBXM file, which can be opened in Roblox Studio.

Example

-- Save the entire game
saveinstance({
    FilePath = "game.rbxl"
})

-- Save a specific model
saveinstance({
    FilePath = "model.rbxm",
    Object = workspace.MyModel
})

-- Save with options
saveinstance({
    FilePath = "full_game.rbxl",
    NilInstances = true,
    Mode = "full"
})

Notes

  • File is saved to the workspace folder
  • Large games may take time to save
  • Some instances may not save properly

On this page