Skip to content

luau/UniversalSynSaveInstance

Repository files navigation

Loadstring

local Params = {
 RepoURL = "https://raw.githubusercontent.com/luau/UniversalSynSaveInstance/main/",
 SSI = "saveinstance",
}
local synsaveinstance = loadstring(game:HttpGet(Params.RepoURL .. Params.SSI .. ".luau", true), Params.SSI)()
local Options = {} -- Documentation here https://luau.github.io/UniversalSynSaveInstance/api/SynSaveInstance
synsaveinstance(Options)

Universal Syn Save Instance

Or shortly USSI, a project aimed at resurrecting saveinstance function from Synapse X.
Reason: Many tools fail miserably at providing good user experience when it comes to tinkering with saving instances.

Warning

As stated under the Section 7 (b) in the LICENSE:

  • You MUST always include the following Credit string: UniversalSynSaveInstance https://discord.gg/wx4ThpAsmw
  • You are NOT allowed to claim authorship of the source code provided in this repository
  • You MUST always include the following License

Disclaimer

This project is provided for development, debugging, archival, and research purposes within the Roblox platform.

It is not intended for misuse, including violating platform rules, unauthorized access, or redistribution of content without permission.

Users are responsible for ensuring their usage complies with all applicable rules, including Roblox’s Terms of Use.

The maintainers do not support or condone misuse of this software and are not responsible for how it is used.

Tip

Important part about this saveinstance is that it doesn't modify game state, which helps maintain stability and compatibility.
You can also enable the SafeMode option to improve compatibility and ensure more reliable saving across a wide range of experiences.

You can read more about it here Documentation If this script is helpful to you, please click ⭐ Star in the upper right corner of the page to support it, thank you!

Documentation

Documentation

💖 Support Us & Our Work

Buy Me a Coffee at ko-fi.com ko-fi
ko-fi

DISCORD SERVER:

https://discord.com/invite/wx4ThpAsmw / https://discord.gg/wx4ThpAsmw
Our Official Discord Server!

TO-DOs

  • Look into adding support for Binary Format Output (rbxl/rbxm)

    • Users can already convert to Binary Format by
      1. Open the File
      2. Click on top left "FILE" text and select "Save to File As"
      3. Make Sure rbxl/rbxm format is selected (not XML!)
      4. Click Save
    • .RBXL files are similar to .RBXLX files but are saved in Binary format, which helps reduce the file size.
    • ! Check out Rojo Rbx Dom Binary & Roblox Format Specifications Binary for more documentation about the Binary File Format!
    • ! Also see buffer, bit32 libraries as well as pack/unpack from the string library for more information on how you can implement something like this!
    • ! Rbx-Binary-Format
  • Add table.clone instead {} in some cases if possible

  • Support for Model files:

    • rbxmx (xml)
    • rbxm (binary)
  • Implement Luau Syntax (important for performance!):

    • Compound Operators
    • Avoid using next, ipairs & pairs
    • Interpolated strings instead of concat Slower
    • Type-checking (😩🙀)
    • if-then-else expressions No reason to
    • Floor division
  • Speed things up as much as possible

    • Requires benchmarks
  • Support for as many KRNL-like saveinstance Options & UNC:

    • Change mode to invalid mode like "custom" if you only want to save ExtraInstances
    • Decompile (! This takes priority over OPTIONS.noscripts if set !)
    • DecompileIgnore
    • DecompileTimeout (! This takes priority over OPTIONS.timeout if set !)
    • ExtraInstances
    • FilePath
    • IgnoreDefaultProps
    • IsolateStarterPlayer
    • NilInstances
    • Object (for .rbxmx files)
    • RemovePlayerCharacters
    • SavePlayers
    • ShowStatus
      • Add Drawing Library support for ShowStatus Can't reliably test if it's working on a tool
    • IsolatePlayerGui (same as IsolateLocalPlayer)
    • Callback
    • CopyToClipboard/Clipboard Use Callback instead
    • Binary (rbxl/rbxm)
  • Remove buffersize, savebuffer & so on for sake of performance by concatenating strings to total string then writing it to file (no extra steps like table.concat) table.concat proved faster in the case of huge amount of concatenations

    • Test table.concat vs string ..= with a full buffer (this benchmark differs per usecase)
  • Add Option to restart saveinstance from the point that it crashed on (perhaps by skipping)

  • Maybe modes should do more than just determining the list of instances to save, like changing IgnoreDefaultProperties to false if mode is "full" for example

  • Add Lua & Luau versions instead of merged (WARNING: LUAU MIGHT BE MORE UPDATED THAN LUA VERSION, lua version exists just for the sake of old & bad tools, ask devs of your tools to support luau as its latest & greatest)

  • Add Support for multiple Instances to be saved as a model IsModel = true & ExtraInstances

  • Force disable ParticleEmitters in case something like IgnorePropertiesOfNotScriptsOnScriptsMode is enabled (they stack in one place and create huge lag)

  • Be able to specify which special properties you want saved (to avoid saving all)

Acknowledgments

Important

This document is based largely on the efforts of @Anaminus & @Dekkonot, authors of the Roblox Format Specifications. Additional resources include:

*** View source code of this file for more credits

Sponsor this project

Contributors