Class
Plugin
NotCreatable
The main object responsible for creating custom Studio widgets, toolbars, buttons, and other plugin UI elements.
Plugin is the main object responsible for creating custom Studio widgets,
plugin toolbars, plugin buttons, and more. The Plugin object can be accessed
through the RobloxGlobals.plugin global reference in a Script
that is executed as a plugin.
Properties 4#
CollisionEnabledboolean | Returns whether the user has enabled Collisions in Studio's toolbar.ReadSafeReadOnlyNotReplicated |
DisableUIDragDetectorDragsboolean | If true, toolbars and buttons for the plugin will ignore dragging
related to a UIDragDetector instance.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe |
GridSizefloat | Returns the grid snapping size the user has set in Studio.ReadSafeReadOnlyNotReplicated |
IsDebuggableboolean | Indicates whether the plugin's scripts can be debugged in Studio.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe |
CollisionEnabled: boolean#
ReadOnlyNotReplicatedReadSafe
Returns whether the user has enabled Collisions in Studio's toolbar.
DisableUIDragDetectorDrags: boolean#
Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe
If true, toolbars and buttons for the plugin will ignore dragging
related to a UIDragDetector instance.
GridSize: float#
ReadOnlyNotReplicatedReadSafe
Returns the grid snapping size the user has set in Studio's toolbar. Note
that this property may have slight rounding errors; for example it may be
0.0099999997764826 for a user setting of 0.01, or 0.4000000059604645
for a user setting of 0.4.
IsDebuggable: boolean#
Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe
Indicates whether the plugin's scripts can be debugged in Studio. This property is not accessible through scripts.
Methods 32#
| Activate | Sets the state of the calling plugin to activated.PluginSecurity security |
| CreateDockWidgetPluginGui | Creates a DockWidgetPluginGui given a
DockWidgetPluginGuiInfo.PluginSecurity securityDeprecatedYields |
| CreateDockWidgetPluginGuiAsync | Creates a DockWidgetPluginGui given a
DockWidgetPluginGuiInfo.PluginSecurity securityYields |
| CreatePluginAction | Creates a PluginAction which represents a generic performable
action in Studio with no directly‑associated PluginToolbarButton.PluginSecurity security |
| CreatePluginMenu | Creates a new plugin menu.PluginSecurity security |
| CreateToolbar | Creates a new PluginToolbar with the given name.PluginSecurity security |
| Deactivate | Deactivates the plugin.PluginSecurity security |
| GetJoinMode | Returns the JointCreationMode the user has set in Studio's toolbar.PluginSecurity security |
| GetMouse | Returns a Mouse that can be used while the plugin is active.PluginSecurity security |
| GetSelectedRibbonTool | Returns the currently selected RibbonTool.PluginSecurity security |
| GetSetting | Retrieves a previously stored value with the given key, or nil if the
given key doesn't exist.PluginSecurity security |
| GetStudioUserId | Returns the Studio user's userId if they're logged in, otherwise returns 0.PluginSecurity security |
| ImportFbxAnimation | Prompts the user to open a .fbx animation file that can be loaded onto
the rigModel, then proceeds to insert the animation as a
KeyframeSequence in the Workspace.PluginSecurity securityYields |
| ImportFbxAnimationAsync | Prompts the user to open a .fbx animation file that can be loaded onto
the rigModel, then proceeds to insert the animation as a
KeyframeSequence in the Workspace.PluginSecurity securityYields |
| ImportFbxRig | Prompts the user to open a .fbx file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the Workspace.PluginSecurity securityDeprecatedYields |
| ImportFbxRigAsync | Prompts the user to open a .fbx file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the Workspace.PluginSecurity securityYields |
| Intersect | Intersects the given parts and returns the resulting
IntersectOperation.PluginSecurity security |
| IsActivated | Returns true if this plugin is currently active, after having been
activated via the Activate() function.PluginSecurity security |
| IsActivatedWithExclusiveMouse | Returns true if this plugin is currently active with an exclusive mouse.PluginSecurity security |
| Negate | Negates the given parts and returns the resulting
NegateOperations.PluginSecurity security |
| OpenScript | Used to open the given script instance in an editor window, in Roblox studio, at the given line. If no line is given as an argument it will default to 1.PluginSecurity security |
| OpenWikiPage | Opens the context help window to the wiki page that url links to.PluginSecurity security |
| PromptForExistingAssetId | Opens a window in Roblox Studio that prompts the user to select an
existing AssetType.Animation asset. The assetType parameter must
be Animation; other values are not supported and cause an error.PluginSecurity securityYields |
| PromptForExistingAssetIdAsync | Opens a window in Roblox Studio that prompts the user to select an
existing AssetType.Animation asset. The assetType parameter must
be Animation; other values are not supported and cause an error.PluginSecurity securityYields |
| PromptSaveSelection | Prompts the user to save their current selection with the specified file name.PluginSecurity securityDeprecatedYields |
| PromptSaveSelectionAsync | Prompts the user to save their current selection with the specified file name.PluginSecurity securityYields |
| SaveSelectedToRoblox | Opens an upload window for the user's current selection.PluginSecurity security |
| SelectRibbonTool | Activates the specified Roblox Studio tool.PluginSecurity security |
| Separate | Separates the given UnionOperations and returns the
resulting parts.PluginSecurity security |
| SetSetting | Stores a given value for later use under the given key. The value will persist even after Studio is closed.PluginSecurity security |
| StartDrag | Starts a drag action given a dictionary of parameters.PluginSecurity security |
| Union | Unions the given parts and returns the resulting UnionOperation.PluginSecurity security |
Activate(exclusiveMouse: boolean): ()#
PluginSecurity security
This method sets the state of the calling plugin to activated. Activating
the plugin allows mouse control through the
GetMouse() method.
At any given time, there are either 0 or 1 activated plugins. Activating a
plugin will deactivate all other plugins and they will receive a
Deactivation event.
See Also#
IsActivatedWithExclusiveMouse()which returnstrueif the plugin is currently active with an exclusive mouse, after having been activated via this method.Unloadingwhich fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating.
| Name | Type | Default | Description |
|---|---|---|---|
exclusiveMouse | boolean | A boolean specifying whether to activate the plugin with exclusive
mouse. If true, a PluginMouse can be retrieved via
GetMouse(). |
Returns
()
CreateDockWidgetPluginGui(pluginGuiId: string, dockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo): DockWidgetPluginGui#
YieldsDeprecatedPluginSecurity securityDeprecated
Deprecated. This method has been superseded by
CreateDockWidgetPluginGuiAsync().
This method has been superseded by
CreateDockWidgetPluginGuiAsync().
It creates a new DockWidgetPluginGui from the given
DockWidgetPluginGuiInfo.
| Name | Type | Default | Description |
|---|---|---|---|
pluginGuiId | string | A unique and consistent identifier used to storing the widget's dock state and other internal details. | |
dockWidgetPluginGuiInfo | DockWidgetPluginGuiInfo | Describes the DockWidgetPluginGui to create (initial state,
size, etc). |
Returns
CreateDockWidgetPluginGuiAsync(pluginGuiId: string, dockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo): DockWidgetPluginGui#
YieldsPluginSecurity security
This method creates a new DockWidgetPluginGui from the given
DockWidgetPluginGuiInfo. The first parameter, pluginGuiId,
should be a unique and consistent string. It is used to save the state of
the widget's dock state and other internal details.
| Name | Type | Default | Description |
|---|---|---|---|
pluginGuiId | string | A unique and consistent identifier used to storing the widget's dock state and other internal details. | |
dockWidgetPluginGuiInfo | DockWidgetPluginGuiInfo | Describes the DockWidgetPluginGui to create (initial state,
size, etc). |
Returns
CreatePluginAction(actionId: string, text: string, statusTip: string, iconName: string, allowBinding: boolean = true): PluginAction#
PluginSecurity security
This method creates a PluginAction which represents a generic
performable action in Studio with no directly‑associated
PluginToolbarButton.
See also CreatePluginMenu() which
creates a Studio PluginMenu that can display a list of
PluginActions.
| Name | Type | Default | Description |
|---|---|---|---|
actionId | string | Must be a unique string that identifies this PluginAction from others. | |
text | string | The displayed name of the action. | |
statusTip | string | The displayed description of the action. | |
iconName | string | The name of the icon used to display the plugin. | |
allowBinding | boolean | true | Whether the PluginAction will be hidden from Studio's
shortcuts view. Useful for contextual actions. Defaults to true. |
Returns
CreatePluginMenu(id: string, title: string, icon: string): PluginMenu#
PluginSecurity security
This function creates a new PluginMenu which is a context menu
that can be shown in Studio that displays a list of
PluginActions and also supports submenus.
| Name | Type | Default | Description |
|---|---|---|---|
id | string | Unique ID for the menu. | |
title | string | The text to be displayed when used as a submenu. | |
icon | string | The icon to be displayed when used as a submenu. |
Returns
CreateToolbar(name: string): PluginToolbar#
PluginSecurity security
This method creates a new PluginToolbar with the given name. The
toolbar can then be used to create plugin buttons.
| Name | Type | Default | Description |
|---|---|---|---|
name | string | The visible text on the toolbar, labeling the group of buttons contained within. |
Returns
Deactivate(): ()#
PluginSecurity security
Deactivates the plugin. This will disengage the associated
PluginMouse if it has been activated.
See Also#
Activate()which sets the state of the calling plugin to activated.Deactivationwhich fires when the plugin is deactivated.Unloadingwhich fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating.
Returns
()
GetJoinMode(): JointCreationMode#
PluginSecurity security
Returns the JointCreationMode the user has set in Studio's toolbar.
Returns
GetMouse(): PluginMouse#
PluginSecurity security
This method returns a PluginMouse that can be used while the
plugin is active through Activate().
Returns
GetSelectedRibbonTool(): RibbonTool#
PluginSecurity security
This method returns the currently selected RibbonTool.
Returns
GetSetting(key: string): Variant#
PluginSecurity security
Retrieves a previously stored value with the given key, or nil if the
given key doesn't exist.
Because multiple instances of the same plugin can run simultaneously (for example, if multiple Studio windows are open), you shouldn't depend on this value staying the same over time. The other plugin instances can update the setting at any time.
This call can silently fail and return nil if multiple instances of the
same plugin are actively reading and writing data. If your plugin expects
to write to settings frequently, you should double-check the returned
value from this call after a short while to distinguish between a setting
being temporarily unavailable and a setting not existing.
| Name | Type | Default | Description |
|---|---|---|---|
key | string | The string key that was previously passed to
SetSetting(). |
Returns
Variant
GetStudioUserId(): int64#
DeprecatedPluginSecurity security
Returns the Studio user's userId if they're logged in, otherwise returns 0.
Returns
int64
ImportFbxAnimation(rigModel: Instance, isR15: boolean = true): Instance#
YieldsDeprecatedPluginSecurity security
This method prompts the user to open a .fbx animation file that can be
loaded onto the rigModel, then proceeds to insert the animation as a
KeyframeSequence named "ImportedAnimation" in the
Workspace. The isR15 parameter determines whether the file is
interpreted as an R15 rig and defaults to true.
Returns the resulting KeyframeSequence instance. Errors if
rigModel is nil or if the user cancels the file dialog without
selecting a file.
| Name | Type | Default | Description |
|---|---|---|---|
rigModel | Instance | The rig model that the imported animation will be applied to. | |
isR15 | boolean | true | Whether the animation file should be interpreted as an R15 rig.
Defaults to true. |
Returns
ImportFbxAnimationAsync(rigModel: Instance, isR15: boolean = true): Instance#
YieldsPluginSecurity security
This function prompts the user to open a .fbx animation file that can be
loaded onto the rigModel, then proceeds to insert the animation as a
KeyframeSequence in the Workspace.
| Name | Type | Default | Description |
|---|---|---|---|
rigModel | Instance | The rig model that the imported animation will be applied to. | |
isR15 | boolean | true | Whether the animation file should be interpreted as an R15 rig.
Defaults to true. |
Returns
ImportFbxRig(isR15: boolean = true): Instance#
YieldsDeprecatedPluginSecurity securityDeprecated
Deprecated. This method has been superseded by
ImportFbxRigAsync().
This method has been superseded by
ImportFbxRigAsync(). It prompts the
user to open a .fbx file, uploads the individual components of the model
as meshes, and generates a character rig for use in animation, which is
loaded into the Workspace.
| Name | Type | Default | Description |
|---|---|---|---|
isR15 | boolean | true | Whether the rig file should be interpreted as R15. Defaults to true. |
Returns
ImportFbxRigAsync(isR15: boolean = true): Instance#
YieldsPluginSecurity security
Prompts the user to open a .fbx file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the Workspace.
| Name | Type | Default | Description |
|---|---|---|---|
isR15 | boolean | true | Whether the rig file should be interpreted as R15. Defaults to true. |
Returns
Intersect(objects: Instances): Instance#
PluginSecurity security
Intersects the given parts and returns the resulting
IntersectOperation.
| Name | Type | Default | Description |
|---|---|---|---|
objects | Instances | The array of BaseParts to intersect. |
Returns
IsActivated(): boolean#
PluginSecurity security
This function returns true if this plugin is currently active, after
having been activated via the Activate()
function.
Returns
boolean— A boolean indicating whether the plugin is currently active.
IsActivatedWithExclusiveMouse(): boolean#
PluginSecurity security
This function returns true if this plugin is currently active with an
exclusive mouse, after having been activated via the
Activate() function. If this returns true, a
PluginMouse can be retrieved via
GetMouse().
See Also#
Deactivationwhich fires when the plugin is deactivated.Unloadingwhich fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating.
Returns
boolean— Whether this plugin is currently active with an exclusive mouse.
Negate(objects: Instances): Instances#
PluginSecurity security
Negates the given parts and returns the resulting
NegateOperations.
| Name | Type | Default | Description |
|---|---|---|---|
objects | Instances | The array of BaseParts to negate. |
Returns
Instances
OpenScript(script: LuaSourceContainer, lineNumber: int = 1): ()#
DeprecatedPluginSecurity security
Used to open the given script instance in an editor window, in Roblox studio, at the given line. If no line is given as an argument it will default to 1.
Prefer
ScriptEditorService:OpenScriptDocumentAsync(),
which provides better integration with other script editor APIs and is
more extensible.
| Name | Type | Default | Description |
|---|---|---|---|
script | LuaSourceContainer | The LuaSourceContainer script instance to open. | |
lineNumber | int | 1 | The line number to navigate to in the editor. Defaults to 1. |
Returns
()
OpenWikiPage(url: string): ()#
PluginSecurity security
Opens the context help window to the wiki page that url links to.
| Name | Type | Default | Description |
|---|---|---|---|
url | string | The URL of the wiki/documentation page to open. |
Returns
()
PromptForExistingAssetId(assetType: string): int64#
YieldsPluginSecurity security
Opens a window in Roblox Studio that prompts the user to select an
existing animation asset from the user's inventory. Pass Animation as
the assetType argument.
Returns the selected animation asset ID as an int64, or -1 if the user
closes the dialog without selecting an asset. If assetType is not
Animation, this method errors.
| Name | Type | Default | Description |
|---|---|---|---|
assetType | string | The asset type to browse. Only Animation is supported. |
Returns
int64
PromptForExistingAssetIdAsync(assetType: string): int64#
YieldsPluginSecurity security
Opens a window in Roblox Studio that prompts the user to select an
existing animation asset from the user's inventory. Pass Animation as
the assetType argument.
Returns the selected animation asset ID as an int64, or -1 if the user
closes the dialog without selecting an asset. If assetType is not
Animation, this method errors.
| Name | Type | Default | Description |
|---|---|---|---|
assetType | string | The asset type to browse. Only Animation is supported. |
Returns
int64
PromptSaveSelection(suggestedFileName: string): boolean#
YieldsDeprecatedPluginSecurity securityDeprecated
Deprecated. This method has been superseded by
PromptSaveSelectionAsync().
This method has been superseded by
PromptSaveSelectionAsync(). It
prompts the user to save their current selection with the specified file
name and returns whether the user completed the save.
| Name | Type | Default | Description |
|---|---|---|---|
suggestedFileName | string | The default file name shown in the save dialog. Defaults to an empty string. |
Returns
boolean
PromptSaveSelectionAsync(suggestedFileName: string): boolean#
YieldsPluginSecurity security
Prompts the user to save their current selection with the specified file
name. Returns true if the user did save the file.
| Name | Type | Default | Description |
|---|---|---|---|
suggestedFileName | string | The default file name shown in the save dialog. Defaults to an empty string. |
Returns
boolean
SaveSelectedToRoblox(): ()#
PluginSecurity security
Opens an upload window for the user's current selection.
Returns
()
SelectRibbonTool(tool: RibbonTool, position: UDim2): ()#
PluginSecurity security
Activates the specified Roblox Studio tool. If the tool opens a window, the position parameter specifies where it should be shown on the screen.
An object must be selected in order for this to work correctly. Also note
that altering the scale fields of the position property will not affect
the dialog popups.
| Name | Type | Default | Description |
|---|---|---|---|
tool | RibbonTool | The RibbonTool to activate. | |
position | UDim2 | The UDim2 screen position at which to show the tool's
dialog window, if applicable. |
Returns
()
Separate(objects: Instances): Instances#
PluginSecurity security
Separates the given UnionOperations and returns the
resulting parts.
| Name | Type | Default | Description |
|---|---|---|---|
objects | Instances | The array of UnionOperations to separate. |
Returns
Instances
SetSetting(key: string, value: Variant): ()#
PluginSecurity security
Stores a given value for later use under the given key. The value will
persist even after Roblox Studio is closed. These settings are saved in
.json format as a map with string keys. Arrays are automatically
converted to maps by converting the numeric keys to strings first.
Note that the .json format imposes additional restrictions, including
the following characters which can corrupt the settings file:
- Backslashes (
\) in keys or values, in particular escaped quotes (\"). - Newlines (
\n) in keys. - Quotes (
") in keys. - Periods (
.) in keys.
This call can silently fail if multiple instances of the same plugin are
actively reading and writing data. If your plugin expects to write to
settings frequently, you may check that the data has been properly written
by calling GetSetting().
| Name | Type | Default | Description |
|---|---|---|---|
key | string | The string key to store the value under. | |
value | Variant | The value to store. Must be JSON-serializable (string, number,
boolean, table, or nil). |
Returns
()
StartDrag(dragData: Dictionary): ()#
PluginSecurity security
This method initiates a drag action using a dictionary of parameters. The parameters are as follows:
| Name | Type | Default | Description |
|---|---|---|---|
Sender |
string | "" |
Identifies the source of the drag action to the drop target |
MimeType |
string | "" |
The MIME type of Data.
|
Data |
string | "" |
Information about the drag action, for example what is being dragged. Should be used by the drop target. |
MouseIcon |
Datatype.Content |
"" |
The icon to use for the mouse cursor during the drag. If empty, uses the default cursor. |
DragIcon |
Datatype.Content |
"" |
An image to render under the mouse cursor during the drag. This should represent the item being dragged. |
HotSpot |
Datatype.Vector2 |
Datatype.Vector2.new(0, 0) |
The pixel offset from the top-left where the cursor should "hold" the DragIcon.
|
See also PluginGui.PluginDragEntered,
PluginGui.PluginDragMoved, PluginGui.PluginDragDropped,
and PluginGui.PluginDragLeft.
| Name | Type | Default | Description |
|---|---|---|---|
dragData | Dictionary | A dictionary describing the drag, including fields such as Sender,
MimeType, Data, MouseIcon, DragIcon, and HotSpot. |
Returns
()
Union(objects: Instances): Instance#
PluginSecurity security
Unions the given parts and returns the resulting UnionOperation.
| Name | Type | Default | Description |
|---|---|---|---|
objects | Instances | The array of BaseParts to union together. |
Returns
Events 2#
| Deactivation | Fired when the plugin is deactivated.PluginSecurity security |
| Unloading | Fires immediately before the Plugin stops running.PluginSecurity security |
Deactivation()#
PluginSecurity security
Fired when the Plugin is deactivated. This occurs when either the
plugin code calls Deactivate(), or because
some other plugin called Activate(), which
forces all other plugins to lose their active state.
See also Unloading which fires immediately before
the plugin is unloaded or reloaded via uninstallation, deactivation, or
updating.
Unloading()#
PluginSecurity security
This event fires immediately before the Plugin stops running.
Plugins are unloaded when disabled, uninstalled, about to be updated, or
when the place is closing.
It enables a plugin to clean up after itself before its scripts stop
running, e.g. to remove unnecessary instances from the DataModel.
If a plugin does not clean up properly, the old copies will remain. When
this occurs, users may be forced to close and reopen the place which is a
bad user experience.
Plugin-related instances such as
PluginToolbarButtons,
DockWidgetPluginGuis, and
PluginGuis are automatically cleaned up when the plugin
is unloaded so there is no need to remove them.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild