SynSaveInstance
Represents the options for saving instances with custom settings using the synsaveinstance function.
Types
CustomOptions table
interface
CustomOptions table {
__DEBUG_MODE:
boolean
--
Recommended to enable if you wish to help us improve our products and find bugs / issues with it! Default: false
ReadMe:
boolean
--
Default: true
SafeMode:
boolean
--
Kicks you before Saving, which prevents you from being detected in any game. Default: false
ShutdownWhenDone:
boolean
--
Shuts the game down after saveinstance is finished. Default: false
AntiIdle:
boolean
--
Prevents the 20-minute-Idle Kick. Default: true
ShowStatus:
boolean
--
Default: true
Callback:
boolean
--
If set, the serialized data will be sent to the callback function instead of to file. Default: nil
mode:
string
--
Valid modes: full, optimized, scripts. Change this to invalid mode like "invalid" if you only want ExtraInstances. "optimized" mode is NOT supported with @Object option. Default: "optimized"
noscripts:
boolean
--
Aliases: Decompile
. Default: false
scriptcache:
boolean
--
Default: true
decomptype:
string
--
- Deprecated. Default: Uses your executor's decompiler, if available.
timeout:
number
--
If the decompilation run time exceeds this value it gets cancelled. Set to -1 to disable timeout (unreliable). Aliases: DecompileTimeout
. Default: 10
DecompileJobless:
boolean
--
Includes already decompiled code in the output. No new scripts are decompiled. Default: false
SaveBytecode:
boolean
--
Includes bytecode in the output. Useful if you wish to be able to decompile it yourself later. Default: false
DecompileIgnore:
{
Instance
|
Instance.ClassName
|
[
Instance.ClassName
]
=
{
Instance.Name
}
}
--
- Ignores match & it's descendants by default. To Ignore only the instance itself set the value to
= false
. Examples: "Chat", - Matches any instance with "Chat" ClassName, Players = {"MyPlayerName"} - Matches "Players" Class AND "MyPlayerName" Name ONLY,workspace
- matches Instance by reference,[workspace] = false
- matches Instance by reference and only ignores the instance itself and not it's descendants. Default: {TextChatService}
IgnoreList:
{
Instance
|
Instance.ClassName
|
[
Instance.ClassName
]
=
{
Instance.Name
}
}
--
Structure is similar to @DecompileIgnore except = false
meaning if you ignore one instance it will automatically ignore it's descendants. Default: {CoreGui, CorePackages}
ExtraInstances:
{
Instance
}
--
If used with any invalid mode (like "invalidmode") it will only save these instances. Default: {}
IgnoreProperties:
table
--
Ignores properties by Name. Default: {}
SaveCacheInterval:
number
--
The less the value the more often it saves, but that would mean less performance due to constantly saving. Default: 0x1600 * 10
FilePath:
string
--
Must only contain the name of the file, no file extension. Default: false
Object:
Instance
--
- If provided, saves as .rbxmx (Model file) instead. If Object is game, it will be saved as a .rbxl file. MUST BE AN INSTANCE REFERENCE, FOR EXAMPLE - game.Workspace.
"optimized"
mode is NOT supported with this option. If IsModel is set to false then Object specified here will be saved as a place file. Default: false
IsModel:
boolean
--
If Object is specified then sets to true automatically, unless you set it to false. Default: false
NilInstances:
boolean
--
Save instances that aren't Parented (Parented to nil). Default: false
NilInstancesFixes:
{
[
Instance.ClassName
]
=
function
}
--
- This can cause some Classes to be fixed even though they might not need the fix (better be safe than sorry though). For example, Bones inherit from Attachment if we dont define them in the NilInstancesFixes then this will catch them anyways. TO AVOID THIS BEHAVIOR USE THIS EXAMPLE: {ClassName_That_Doesnt_Need_Fix = false}. Default: {Animator = function, AdPortal = function, BaseWrap = function, Attachment = function}
IgnoreDefaultProperties:
boolean
--
Ignores default properties during saving. Default: true
IgnoreNotArchivable:
boolean
--
Ignores the Archivable property and saves Non-Archivable instances. Default: true
IgnorePropertiesOfNotScriptsOnScriptsMode:
boolean
--
Ignores property of every instance that is not a script in "scripts" mode. Default: false
IgnoreSpecialProperties:
boolean
--
Prevents calls to gethiddenproperty
and uses fallback methods instead. This also helps with crashes. If your file is corrupted after saving, you can try turning this on. Default: false
IsolateLocalPlayer:
boolean
--
Saves Children of LocalPlayer as separate folder and prevents any instance of ClassName Player with .Name identical to LocalPlayer.Name from saving. Default: false
IsolateStarterPlayer:
boolean
--
If enabled, StarterPlayer will be cleared and the saved starter player will be placed into folders. Default: false
IsolateLocalPlayerCharacter:
boolean
--
Saves Children of LocalPlayer.Character as separate folder and prevents any instance of ClassName Player with .Name identical to LocalPlayer.Name from saving. Default: false
RemovePlayerCharacters:
boolean
--
Ignore player characters while saving. (Enables SaveNotCreatable automatically). Default: true
SaveNotCreatable:
boolean
--
- Includes non-serializable instances as Folder objects (Name is misleading as this is mostly a fix for certain NilInstances and isn't always related to NotCreatable). Default: false
NotCreatableFixes:
table
<
Instance.ClassName
>
--
- {"Player"} is the same as {Player = "Folder"}; Format like {SpawnLocation = "Part"} is only to be used when SpawnLocation inherits from "Part" AND "Part" is Creatable. Default: { "", "Player", "PlayerScripts", "PlayerGui", "TouchTransmitter" }
IsolatePlayers:
boolean
--
- This option does save players, it's just they won't show up in Studio and can only be viewed through the place file code (in text editor). More info at https://github.com/luau/UniversalSynSaveInstance/issues/2. Default: false
AlternativeWritefile:
boolean
--
- Splits file content string into segments and writes them using appendfile. This might help with crashes when it starts writing to file. Though there is a risk of appendfile working incorrectly on some executors. Default: true
IgnoreDefaultPlayerScripts:
boolean
--
- **RISKY: Ignores Default PlayerScripts like PlayerModule & RbxCharacterSounds. Prevents crashes on certain Executors. Default: true
IgnoreSharedStrings:
boolean
--
- RISKY: FIXES CRASHES (TEMPORARY, TESTED ON ROEXEC ONLY). FEEL FREE TO DISABLE THIS TO SEE IF IT WORKS FOR YOU. Default: true
SharedStringOverwrite:
boolean
--
- RISKY: if the process is not finished aka crashed then none of the affected values will be available. SharedStrings can also be used for ValueTypes that aren't
SharedString
, this behavior is not documented anywhere but makes sense (Could create issues though, due to potential ValueType mix-up, only works on certain types which are all base64 encoded so far). Reason: Allows for potential smaller file size (can also be bigger in some cases). Default: false
TreatUnionsAsParts:
boolean
--
- RISKY: Converts all UnionOperations to Parts. Useful if your Executor isn't able to save (read) Unions, because otherwise they will be invisible. Default: false (except Solara)
}
- Structure of the main CustomOptions table.
-
Note: Options are case-insensitive, meaning you could type
NilInstances
option asnilInStaNces
and it would still be valid. Anonymous {boolean|table{UserId = string, Name = string}} -- * RISKY: Cleans the file of any info related to your account like: Name, UserId. This is useful for some games that might store that info in GUIs or other Instances. Might potentially mess up parts of strings that contain characters that match your Name or parts of numbers that match your UserId. Can also be a table with UserId & Name keys. Default: false
OptionsAliases
interface
OptionsAliases {
FilePath:
string
--
FileName
IgnoreDefaultProperties:
string
--
IgnoreDefaultProps
SaveNotCreatable:
string
--
SaveNonCreatable
IsolatePlayers:
string
--
SavePlayers
scriptcache:
string
--
DecompileJobless
timeout:
string
--
DecompileTimeout
IgnoreNotArchivable:
string
--
IgnoreArchivable
RemovePlayerCharacters:
string
--
INVERSE SavePlayerCharacters
}
Aliases for the SynSaveInstance.CustomOptions table.
Functions
saveinstance
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsSynSaveInstance.
saveinstance
(
Parameter_1:
variant
<
table,
table
<
Instance
>
>
,
--
Can either be SynSaveInstance.CustomOptions table or a filled with instances ({Instance}), (then it will be treated as ExtraInstances with an invalid mode and IsModel will be true).
Parameter_2:
table
--
[OPTIONAL] If present, then Parameter_2 will be assumed to be SynSaveInstance.CustomOptions table. And then if the Parameter_1 is an Instance, then it will be assumed to be SynSaveInstance.CustomOptions table.Object. If Parameter_1 is a table filled with instances ({Instance}), then it will be assumed to be SynSaveInstance.CustomOptions table.ExtraInstances and IsModel will be true). This exists for sake compatibility with saveinstance(game, {})
) →
(
)
Saves instances with specified options. Example:
local Params = {
RepoURL = "https://raw.githubusercontent.com/luau/SynSaveInstance/main/",
SSI = "saveinstance",
}
local synsaveinstance = loadstring(game:HttpGet(Params.RepoURL .. Params.SSI .. ".luau", true), Params.SSI)()
local CustomOptions = { SafeMode = true, timeout = 15, SaveBytecode = true }
synsaveinstance(CustomOptions)