A powerful Lua script that exports all scripts from Roblox place files (.rbxl) into organized directory structures, making it easy to version control, review, and manage your Roblox game code.
- Complete Script Export: Extracts all Script, LocalScript, and ModuleScript instances from .rbxl files
- Organized Structure: Maintains Roblox service hierarchy (ServerScriptService, ReplicatedStorage, etc.)
- Nested Script Support: Handles scripts inside other scripts with special
_contents
folders - Rich Metadata: Preserves script properties, paths, and export information in file headers
- Smart File Extensions:
.server.lua
for Server Scripts.client.lua
for Local Scripts.lua
for Module Scripts
- Clean Naming: Sanitizes file and folder names for filesystem compatibility
- Lune - A standalone Luau runtime
- A Roblox place file (.rbxl) to export from
Windows (using Scoop):
scoop install lune
Windows (using Chocolatey):
choco install lune
macOS (using Homebrew):
brew install lune
Linux or manual installation: Download from the Lune releases page
lune run export-scripts.lua MyGame.rbxl
This will create a folder named MyGame-scripts/
with all exported scripts.
lune run export-scripts.lua MyGame.rbxl my-custom-folder
MyGame-scripts/
├── project-info.lua # Export metadata
├── ServerScriptService/
│ ├── MainScript.server.lua
│ └── Services/
│ ├── PlayerManager.lua
│ └── GameManager.lua
├── ReplicatedStorage/
│ ├── Shared/
│ │ ├── Config.lua
│ │ └── Utilities.lua
│ └── Packages/
│ ├── Promise.lua
│ └── Signal.lua
└── StarterPlayer/
└── StarterPlayerScripts/
└── ClientMain.client.lua
export-scripts.lua
- Main exporter scriptexport-scripts.exe
- Pre-compiled Windows executable (if available)rokit.toml
- Rokit configuration for dependency management- Example game files and exported scripts for reference
The exporter can be customized by modifying the CONFIG
table in export-scripts.lua
:
local CONFIG = {
-- File extensions for different script types
extensions = {
Script = ".server.lua",
LocalScript = ".client.lua",
ModuleScript = ".lua"
},
-- Services to export (in priority order)
services = {
"ServerScriptService",
"ReplicatedStorage",
"ServerStorage",
"StarterPlayer",
-- ... add more services as needed
},
-- Skip these instances completely
skipInstances = {
"Camera",
"Terrain"
}
}
- Reads the .rbxl file and deserializes it using Lune's Roblox API
- Traverses each configured service (ServerScriptService, ReplicatedStorage, etc.)
- Identifies all script instances recursively, including nested scripts
- Extracts source code and metadata from each script
- Organizes scripts into a clean directory structure
- Preserves important information like script properties and hierarchy in file headers
Each exported script includes a comprehensive header with metadata:
--[[
PlayerManager (ModuleScript)
Path: ServerScriptService → Services
Parent: Services
Properties:
Disabled: false
Exported: 2025-06-27 14:30:15
]]
-- Your script code here...
Contributions are welcome! Here are some ways you can help:
- Bug Reports: Found an issue? Please open an issue with details
- Feature Requests: Have an idea? Let's discuss it in the issues
- Pull Requests: Ready to contribute code? Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
"Module not found" errors
- Ensure Lune is properly installed and in your PATH
- Try running
lune --version
to verify installation
"Permission denied" errors
- Make sure you have write permissions in the output directory
- Try running as administrator on Windows if needed
Empty output or missing scripts
- Check that your .rbxl file isn't corrupted
- Verify the file path is correct
- Some scripts might be in services not included in the CONFIG
- Check existing Issues for similar problems
- Open a new issue with:
- Your operating system
- Lune version (
lune --version
) - Error message or unexpected behavior
- Sample .rbxl file (if possible)
This project is licensed under the MIT License - see the LICENSE file for details.
- Lune - For providing an excellent Luau runtime
- Roblox community - For inspiration and feedback
- Contributors - Thank you for making this project better!
- Supports unlimited nesting depth (with safety limits)
- Handles all standard Roblox script types
- Preserves script properties and metadata
- Cross-platform compatible (Windows, macOS, Linux)
Made with ❤️ for the Roblox development community