The Script tab contains tools for writing and testing scripts. You can only access this tab when you're viewing or editing a script.
Navigate
The Navigate section lets you quickly jump between any open script.
Action | Shortcut | Description |
---|---|---|
Back | ShiftCtrl- (Windows) Shift⌘- (Mac) | Navigates to the previous open script. |
Fwd | ShiftCtrl= (Windows) Shift⌘= (Mac) | Navigates to the next open script. |
Edit
The Edit section lets you search and edit any part of the script, as well as select instances within the Explorer window for bulk actions. See Studio Shortcuts for default shortcuts tied to these actions.
Action | Description |
---|---|
Find | Opens a pop-up menu with the following tools:
|
Replace | Lets you replace one (or all) matches in a script with a new string. |
Select | Opens a pop-up menu with the following tools:
|
Format
The Format section lets you format sections or the entirety of the script for readability. The dropdown lets you select either Format Selection or Format Document.
Action | Shortcut | Description |
---|---|---|
Format Selection | AltShiftF (Windows) ⌥ShiftF (Mac) | Formats the currently selected portion of the script with proper layout and indentation. |
Format Document | Formats the entire script regardless of the current selection. |
Pausing & Resuming Scripts
While playtesting, the Pause Scripts and Resume Scripts buttons are useful for pausing both scripts and rendering, without pausing physics.
Debugging Tools
The Debugger section lets you control the debugger.
Action | Shortcut | Description |
---|---|---|
Step Into | F11 | Moves the debugger into the function on the current line. If there is no function on the current line, the debugger moves to the next line. |
Step Over | F10 | Moves the debugger to the next line of code, not moving into functions. |
Step Out | ShiftF11 | Moves the debugger out of the current function and to the next line of code after the function was initially called. If the current line is not inside a function, the debugger moves to the next line. |
In the neighboring Debug Errors section, you can opt to treat script errors as impromptu breakpoints.
Action | Description |
---|---|
Never | Disables impromptu script debugging. |
On All Exceptions | Flags all errors, even those occurring within pcall. |
On Unhandled Exceptions | Only flags errors that occur in unprotected mode; the debugger ignores errors occurring within pcall . |
Other Actions
The Actions section at the furthest right contains miscellaneous script actions.
Action | Shortcut | Description |
---|---|---|
Go to Script Error | Navigates the cursor to the first instance of an error within your script. | |
Reload Script | CtrlR (Windows) ⌘R (Mac) | Applies any changes that have been made to a script to the active playtest. The changes are not saved to the script outside of the playtest unless your Studio settings are set to auto-save runtime script changes or you confirm to save the changes upon stopping the playtest. This action is only available while playtesting. |
Commit | Commits any changes to the script so the updated script is available to other developers within your team. This action is only available during collaborative sessions. | |
Toggle Comment | Ctrl/ (Windows) ⌘/ (Mac) | Toggles whether a line of script is a comment or not. |
Expand All Folds | CtrlE (Windows) ⌘E (Mac) | Expands all collapsed folds in the script. |
Collapse All Folds | ShiftCtrlE (Windows) Shift⌘E (Mac) | Collapses all foldable sections of the script. |