Seamlessly execute Lua scripts in Roblox through WebSockets directly from Visual Studio Code.
To ensure smooth execution, either run the script manually or place it in your AutoExec folder for automatic execution.
repeat task.wait() until game:IsLoaded()
while task.wait(1) do
pcall(function()
local ws = websocket.connect("ws://localhost:33882/")
if not ws then
print("Failed to establish WebSocket connection")
return
end
print("WebSocket connection established")
ws:Send("auth:" .. game.Players.LocalPlayer.Name)
ws.OnMessage:Connect(function(msg)
local func, err = loadstring(msg)
if err then
ws:Send("compile_err:" .. err)
return
end
pcall(func)
end)
ws.OnClose:Connect(function()
print("WebSocket connection closed")
end)
while ws do wait() end
end)
endTo execute your script every time the file is saved ( Using CTRL + S ), ensure autosaving is turned off in order prevent unintentional executions.
- Open VS Code Settings (
Ctrl + ,on Windows orCmd + ,on Mac). - Search for Auto Save and disable it.
- Now every time you save the file, it will be executed.
If you encounter any issues, feel free to reach out via Discord: h_8r.
- monte & yafyz (Synapse X Execute)