The Editor
The script editor: tabs, the file explorer, the console, and the toolbar.
It's the same editor VS Code uses, so autocomplete, multi-cursor, find and replace and the shortcuts all work how you'd expect.
File explorer
On the left. Shows the workspace scripts/ folder. Double-click a file to open it in a tab.
Tabs
Along the top. Each tab is its own script, so you can have a hub, a scratch file and a test script open at once.
Editor pane
Your code, with Luau highlighting, autocomplete and errors shown inline.
Console pane
Under the editor. Roblox output, your print and warn calls, and errors with a traceback.
Toolbar
Execute, Save and Attach. Attach turns green once you're injected.
Execute sends the current tab to Roblox and runs it. It doesn't save to disk first, so you can keep tweaking a script without leaving files everywhere.
- It runs in the background, so a script that yields won't freeze the editor.
- Running the same tab twice runs it twice. If your script connects events, add a guard or you'll end up with duplicate handlers.
- Errors show up in the console with a traceback. Use debug.traceback() in your own pcall handlers for more.
- You can run as many scripts as you want at once. They all share one global environment.
-- A connect guard, so re-running a tab does not stack handlers.
if _G.__mytool_connection then
_G.__mytool_connection:Disconnect()
end
_G.__mytool_connection = game:GetService("RunService").RenderStepped:Connect(function(dt)
-- per-frame work
end)Use getgenv() for shared stuff
Anything you put on getgenv() stays between executions and every script can see it. Good place for an "already loaded" flag or a shared config.
| Shortcut | Does |
|---|---|
| Ctrl + Space | Open the autocomplete list. |
| Ctrl + F | Find in the current tab. Ctrl + H to replace. |
| Alt + Click | Add another cursor. Ctrl + Alt + Up/Down adds one on the line above or below. |
| Ctrl + / | Comment or uncomment the selection. |
| Ctrl + D | Select the next match of the current word. |
| Ctrl + S | Save the tab to the workspace scripts/ folder. |
| Alt + Shift + F | Format the file. |
The console under the editor shows Roblox's output plus anything your scripts print. It's not the same as the rconsole library, which opens a separate window your script owns. That's useful if you want output that stays after the editor's closed, or you need to ask for input.
rconsolecreate()
rconsolesettitle("my tool")
rconsoleprint("waiting for input...\n")
local answer = rconsoleinput()
rconsoleprint("you typed: " .. answer .. "\n")
rconsoledestroy()The Console chapter has the whole library, including the colored rconsoleinfo / rconsolewarn / rconsoleerr versions.