Overview
Instance to ModuleScript Converter is a plugin tool designed to convert any instance into a digestible module that can be used for game creation, DataStores, table management, and more! This tool can also be used to create a visual reference of your ModuleScripts/tables for easier navigation.
Creator Marketplace Link
Instance to ModuleScript Converter
https://www.roblox.com/library/9067285513/Instance-to-ModuleScript-Converter
Features
Five versatile Output Methods:
- ModuleScript
- Normal Script
- JSON Script
- Output
- Pastebin
[Requires Online Mode and a Pastebin Dev API Key]
Automatically converts all ValueBase Instances*.
- BoolValue
- IntValue
- ObjectValue
- CFrameValue
- etc.
*ValueBases parented under other ValueBases will not be converted into separate subtables and will rather be included as multiple table parameters.
Many different conversion options.
- Properties
- Attributes
- Location Support
- etc.
Selecting a ModuleScript brings up an option to convert it (if its properly formatted) into a Visual Directory via Folders/Configurations for better navigation/viewing.
Extremely useful feature for those that aren’t well versed with Roblox Lua or tend to make formatting mistakes while editing/navigating tables.
Supports most value types.
(See Limitations for unsupported types.)
Screenshots
Use Case Examples
Inventory Systems
Player Data
Store Any Instance/Directory as a ModuleScript/Lua File
Limitations
-
Attempting to convert massive directories (1,000+ Instances with multiple conversion options enabled) may temporarily freeze Roblox Studio while processing. (The amount of time frozen relies entirely on your processing power, system memory, how big of a directory you have selected, and Studio itself.)
-
The more nested item locations a directory has, the longer it will take during the “Locating Strings” step during conversion.
For example: [Selected].Model.Model.Model.Model.Model.Model.Model.Part will take much longer during the “Locating Strings” step than a directory where the deepest instance is closer like [Selected].Model.Part -
If any location type property is nil (CustomPhysicalProperties, Constraints, PrimaryParts, etc.) the converted module will NOT include a variable for that value. I can’t think of a reason of why you would need nil values in a table but if do, you will have to define/write them yourself.
-
This converter does NOT support converting a module back into its instance form! If you know what you’re doing, it should be fairly simple to create a script that can convert the modules back into instances on your own.
-
This converter does NOT support deprecated, hidden, non-replicated properties or the following Instances:
-
Terrain, BinaryStringValues, RayValues
- This converter does NOT support the following values/types:
-
Ray, Axes, Faces
-
At time of writing, this converter supports most types but it will not natively support new types that become added with future Roblox Studio changes.
- If you get this error in your output
Found new value type. Item Name: _ | Value Name: _ | Type: _ | Value: _
and it isn’t listed as an unsupported type above, please comment it below so I can update the plugin to support it!
- If you get this error in your output
-
I’m not going to say you can’t do it because the functionality is there, but this converter is not intended to convert back and forth between ModuleScripts and its Visual Directory. The Visual Directory feature is meant only to visualize a ModuleScript. A Visual Directory should not be converted back into a ModuleScript (especially if you use different settings than when initially converted) and a Visual Directory should not be used as a source of Data unless you know what you are doing. If you do convert back and forth, you may end up with disorganized, incompatible, or inconvertible module data.
Pastebin
In order to upload to Pastebin, the plugin must be set to Online Mode and the Output Mode set to “Pastebin”.
-
You are required to use your own Pastebin Dev API Key to upload to Pastebin which can be found here under the “Your Unique Developer API Key” section.
-
Modules uploaded to Pastebin are temporarily converted to PHP with the plugin, which may result in a 200% or greater increase in module size depending on how many spaces and lines are in the converted module. This conversion process is necessary to send the module info to Pastebin since their API utilizes PHP instead of JSON/raw text.
-
Pastebin has an upload limit of 500 KB for all non-pro users before formatting and 1 MB for all users with PHP formatting.
-
Pastebin has a posting limit of 20 posts per 24 hours and 10 total active unlisted pastes at a time for all non-pro users. You can find more information here.
-
Uploaded modules and their respective links are set to expire 1 hour after conversion and successful upload.
-
Modules uploaded to Pastebin are UNLISTED and can be accessed by bots parsing the website by brute-forcing URLs. Even though I’m not sure what someone would even want to do with a random lua module, if privacy is extremely important regarding your module, select a different Output Method (ModuleScript, Output, etc.).
- The reason new pastes are unlisted instead of private is due to Pastebin requiring 3 different parameters (Dev Key, Username, and Password) when making private posts via the API and I felt like that info was both way too much to input and completely unnecessary for a plugin like this.
NOTE: I was initially going to use paste.ee because it allows unlimited posts and a larger file size limit but ended up running into issues authenticating my Dev Key with both the legacy API and the current paste.ee API, so Pastebin will have to do for now unless someone can provide a dependable third-party open source without limits that has a PHP/JSON API that Roblox can make Post requests to.
Permissions
Script Injection
This permission is required for “ModuleScript”, “Normal Script”, and “JSON Script” Output Methods. This is necessary to create a script object in your game’s experience.
HTTP Requests
While Mode is set to “Online”:
https://setup.rbxcdn.com/<CurrentStudioVersion>-API-Dump.json
The domain path will change according to your current studio version but will always be apart of this same master domain: https://setup.rbxcdn.com/
HTTP Posts
While Mode is set to “Online” AND Output Method is set to “Pastebin”:
https://pastebin.com/api/api_post.php
Roblox Changes That Can Make This Plugin Better
Below are a list of requests I have for Roblox that can help improve functionality and performance of this plugin, in case any Roblox Staff happens to see this post:
- Increase Roblox ProtectedString limit.
Currently, plugins can only create Scripts and ModuleScripts up to a maximum of 195 Kilobytes due to the ProtectedString limit (writing only).
- Create a function that can be accessed by plugins to AutoSave Roblox Studio.
This would be very beneficial to end users that use high performance plugins like this one that can cause hangups during large conversions. It would be a great way to get game experiences backed up in case Studio crashes or freezes longer than expected.
For example: game:AutoSave()
- Create a function for all instance class items that returns a table of string containing all properties of an instance.
For example: Part:GetProperties()
Disclaimers
- This plugin isn’t perfect, may not work as intended, and may not be applicable to all use-cases.
- This plugin should not be relied upon for full fledged game projects, this is meant to be used as a quick and easy-to-use tool rather than a dedicated game design tool. This plugin may prove helpful for some use cases (even for some game projects) but you should have an understanding of how to manage modules on your own rather than completely rely on this tool.
- Conversion errors may occur but I have attempted to provide understandable output errors for as many situations that I could think of.
- This plugin may also completely freeze/crash studio during a large conversion so make sure your experience is saved locally or to Roblox before attempting to make any conversion!
Click to view changelog
Changelog History
March 11th, 2022 | v1.0.0
- Proof of concept
- Basic functionality with no customization
- Extremely long processing times (about half an hour or more for directories larger than 10,000 Instances).
March 26th, 2022 | v2.0.0
- Complete UI Overhaul, Studio theme compatibility, and reformatted into a draggable widget instead of the outdated CoreGUI style.
- Added a progress bar for large operations.
- Added many warnings and errors for different scenarios.
- Added configurable Output Methods and Settings.
- Added Pastebin as an Output Method.
- Added a conversion stop button.
- Conversions now run asynchronous. Greatly reducing conversion time by up to 80% but with a drawback of large conversions freezing Studio.
- Plugin now uses its own copy instead of modifying the original source instance.
- You can now select any properly formatted ModuleScript to be converted into a Visual Directory. (Attempting to convert a ModuleScript that has an infinite yield variable will freeze the plugin!)
March 27th, 2022 | v2.0.1
- Removed Animinus API dump and made all property fetching completely offline.
- Updated the Offline API to be the latest copy of the Official Roblox API instead of a copy of Anaminus’ API. I will continue to manually update the Offline API with the latest Official API every now and again as more classes and properties get added/removed from Roblox or until Roblox provides a proper :GetProperties() function.
- API Version: version-151007c9ec894725
March 28th, 2022 | v2.0.2
- Added an Enum conversion option to allow Enums to be formatted in string instead of Enum. (This will allow slightly smaller file size due to less characters when set to “String”.)
- Intended DevForum Launch & Public Release Date but the plugin thumbnail was rejected/is not processing?? Launch date pushed back until the thumbnail passes manual approval.
March 31st, 2022 | v2.0.3
- Fixed an issue for all instances not having “Parent” listed as a property in the API digest function.
- More than 72 hours later and still not approved. Got to love needing manual approval for a single thumbnail. Phenomenal. What are deadlines, amirite???
April 1st, 2022 | v2.0.3
- I’m tired of waiting. After such a long delay, I’ve decided that I will just initiate the DevForum Launch & Public Release today instead of waiting for something that may never happen. I guess it will just have to launch without a thumbnail for the time being…
April 1st, 2022 | v2.0.3
- Thumbnail finally went through!
April 2nd, 2022 | v2.0.4
- Disabled the functionality to convert ValueBase directories since it resulted in improperly formatted modules. (It can still convert ValueBases, just not from directly selecting a ValueBase as the directory.)
- Changed formatting of the converted module to include “local” before defining the table/array.
- Updated the Online Mode to fetch from the Official Roblox API source. All property fetches while the mode is set to “Online” will now be up to date! Special thanks to Anaminus for providing the alternate rbxcdn domain.
April 4th, 2022 | v2.0.5
- Increased button contrast for better viewability.
- Renamed a conversion option from “Support Location Types” to “Include Object Variables”
April 14th, 2022 | v2.0.6
- Added a “JSON Script” Output Method. All supported types are automatically formatted for JSON compatibility. Converted variables that are
math.huge
orinfinite
will be represented by “inf” since JSON does not support infinite numbers/iterators.- Added a “Color Scale” conversion option. Formatted as follows: 1 = Color3.new, 255 = Color3.fromRGB
May 14th, 2022 | v2.0.7
- Fixed an issue where if the plugin was closed using the x button instead of the toolbar button, the plugin would re-open during every Studio session. The plugin now properly retains it’s persistence across sessions. Using the close button or the toolbar button will change whether or not the plugin will be displayed during your following sessions.