CodeSync is a way to migrate a folder of Lua code to ROBLOX Studio and keep the Studio version up-to-date. This lets you use external editors and version control systems with ROBLOX games (relatively) easily.
CodeSync does not work with Team Create as plugins cannot make HTTP requests if Team Create is in use.
- Install the plugin from here.
- Get the server here.
- Create a config file as described below.
- Run the server with
codesync <config_file>
. - Open the plugin in Studio, enter the port, and press 'Start sync'
- Have fun!
CodeSync uses a simple JSON config file that looks something like this:
{
"Port": 4114,
"AllowExternalRequests": false,
"Path": "D:\\Documents\\CodeSync Test",
"SyncLocation": "game.ReplicatedStorage.TestProject"
}
You can find an example here. There are five keys:
This is the port that the CodeSync server runs on, and must be a number between 1 and 65535. It can't be occupied by other applications, and if you want to allow other computers to access the server, it needs to be accessible by the outside world. If not supplied, this defaults to 4114
.
Setting this to true will cause the CodeSync server to respond to requests that didn't originate from the local machine. If not supplied, this defaults to false
.
This is the path that the CodeSync server exposes. This is required.
This is where the files will be synced in ROBLOX. In this example, it's putting them in the child of game.ReplicatedStorage
named TestProject
. If TestProject (or anything else in the path) doesn't exist when you start syncing, it will create Folder
instances to match this path. This is required.
This is an array of file extensions that CodeSync should sync. If not supplied, CodeSync will sync .lua
and .rbxs
files in the target folder.
CodeSync determines what type of object (LocalScript
, ModuleScript
, or Script
) a file is based on its name. It's simple:
- Files that are in the format
Name.module.extension
are consideredModuleScripts
. - Files that are in the format
Name.local.extension
are consideredLocalScripts
. - Anything else is considered a
Script
. You may choose to name those differently; it will not affect this process.