Using the Decompiler

Synapse X includes another powerful tool to help you develop scripts - the decompiler. The decompiler allows you to see the full Lua source code of any game LocalScript or ModuleScript, allowing you to easily understand how a game works.

To start, you can execute the Script Dumper from the Synapse X Script Hub. After that, it may take 5-10 minutes for all scripts on the game to decompiled, which will then be placed in your Synapse X workspace folder. You can then open up the file and take a look at all game scripts.

An example of a decompiled script is shown below:

-- Decompiled with the Synapse X decompiler.

local v1 = {};
v1.__index = v1;
local v2, v3 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserCameraToggle");
end);
local v4 = v2 or v3;
local v5, v6 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi");
end);
local l__Players__7 = game:GetService("Players");
local l__RunService__8 = game:GetService("RunService");
local l__UserInputService__9 = game:GetService("UserInputService");
local l__UserGameSettings__10 = UserSettings():GetService("UserGameSettings");
local v11 = require(script:WaitForChild("CameraUtils"));`

You may notice that decompiled output looks a lot different from the original source of that script - this is because of debugging information being irrevocably lost during the compilation process. Synapse does its best to make the decompiled source look as good as possible, but unfortunately decompilation is mostly a guessing game, which will inevitably lead to differences in the decompiled output.

If you find specific issues within the decompiler, we would recommend you report them via our Bug Report category on our support site.

Nonetheless, the decompiler is a powerful tool in your arsenal, which we will put to use in our next section, using the debug API.