Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Plugin

This class is not creatable. Instances of this class cannot be created with Instance.new.
Tags: [NotCreatable]

Member index 53

HistoryMember
553CollisionEnabled: bool
646DisableUIDragDetectorDrags: bool
553GridSize: float
573Activate(exclusiveMouse: bool): null
483CreateDockWidgetPluginGui(pluginGuiId: string, dockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo): DockWidgetPluginGui
483CreatePluginAction(actionId: string, text: string, statusTip: string, iconName: string = , allowBinding: bool = true): PluginAction
483CreatePluginMenu(id: string, title: string = , icon: string = ): PluginMenu
483CreateQWidgetPluginGui(pluginGuiId: string, pluginGuiOptions: Dictionary): QWidgetPluginGui
483CreateToolbar(name: string): PluginToolbar
573Deactivate(): null
462GetItem(key: string, defaultValue: Variant): Variant
462GetJoinMode(): JointCreationMode
483GetMouse(): PluginMouse
651GetPluginComponent(name: string): Variant
462GetSelectedRibbonTool(): RibbonTool
462GetSetting(key: string): Variant
462GetStudioUserId(): int64
623GetUri(): Dictionary
462ImportFbxAnimation(rigModel: Instance, isR15: bool = true): Instance
462ImportFbxRig(isR15: bool = true): Instance
648Intersect(objects: Instances): Instance
573Invoke(key: string, arguments: Tuple): null
462IsActivated(): bool
462IsActivatedWithExclusiveMouse(): bool
648Negate(objects: Instances): Instances
462OnInvoke(key: string, callback: Function): Instance
462OnSetItem(key: string, callback: Function): Instance
573OpenScript(script: LuaSourceContainer, lineNumber: int = 1): null
573OpenWikiPage(url: string): null
573PauseSound(sound: Instance): null
573PlaySound(sound: Instance, normalizedTimePosition: double = 0): null
462PromptForExistingAssetId(assetType: string): int64
462PromptSaveSelection(suggestedFileName: string = ): bool
573ResumeSound(sound: Instance): null
573SaveSelectedToRoblox(): null
573SelectRibbonTool(tool: RibbonTool, position: UDim2): null
648Separate(objects: Instances): Instances
573SetItem(key: string, value: Variant): null
573SetReady(): null
573SetSetting(key: string, value: Variant): null
573StartDecalDrag(decal: Instance): null
573StartDrag(dragData: Dictionary): null
573StopAllSounds(): null
648Union(objects: Instances): Instance
462Deactivation()
493Ready()
462Unloading()
648ProcessAssetInsertionDrag(assetId: string, assetTypeId: int, instances: Instances): Instances
573ProcessAssetInsertionDrop(): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 7

HistoryMember
408MDIInstance: MDIInstance
408Bind(key: string, callback: Function): Instance
408BindAndFire(key: string, callback: Function): Instance
326CreatePluginGui(pluginGuiName: string, restoreEnabledState: bool, initialEnabledState: bool): Instance
408Fire(key: string, value: string = ): void
408HasItem(key: string): bool
408RemoveItem(key: string): bool

Description

Plugin is the main object responsible for creating basic Studio widgets, plugin toolbars, plugin buttons, and more. It is a custom add-on to Studio which adds new behavior and features that are not normally included. The Plugin object can be accessed through the plugin global reference in a Script that is executed as a plugin.

History 259

Members 53

Activate

Parameters (1)
exclusiveMousebool
Returns (1)
null

This function sets the state of the calling plugin to activated. Activating the plugin allows mouse control through the Plugin:GetMouse() method.

At any given time there are either 0 or 1 Activated Plugins. Activating a plugin will deactivate all other plugins (they will receive a Plugin.Deactivation event).

See also:

  • Plugin:IsActivatedWithExclusiveMouse(), returns true if this plugin is currently active with an exclusive mouse, after having been activated via this function
  • Plugin.Unloading, fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating

History 6

CollisionEnabled

TypeDefault
bool

Returns whether the user enabled Collisions in studio under the Model tab.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 4

Tags: [ReadOnly, NotReplicated]

CreateDockWidgetPluginGui

Parameters (2)
pluginGuiIdstring
dockWidgetPluginGuiInfoDockWidgetPluginGuiInfo
Returns (1)
DockWidgetPluginGui

CreateDockWidgetPluginGui 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.

This function yields. It will block the calling thread until completion.

History 3

Tags: [Yields]

CreatePluginAction

Parameters (5)Default
actionIdstring
textstring
statusTipstring
iconNamestring
allowBindingbooltrue
Returns (1)
PluginAction

This function creates a PluginAction which is an object that represents a generic performable action in Roblox Studio, with no directly associated Toolbar or Button. In Roblox Studio, they can be assigned a keyboard shortcut under File → Advanced → Customize Shortcuts…, and they can also be added to the Quick Access Toolbar.

When an action is triggered, the PluginAction.Triggered event is signaled.

In order for PluginActions work as expected, they must be created using this function.

See also:

History 5

CreatePluginMenu

Parameters (3)Default
idstring
titlestring
iconstring
Returns (1)
PluginMenu

This function creates a new PluginMenu, which is a context menu that can be shown in Studio that displays a list of PluginActions and supports submenus.

In order for PluginMenus to work as expected, they must be created using this function.

See also:

History 3

CreateQWidgetPluginGui

Parameters (2)
pluginGuiIdstring
pluginGuiOptionsDictionary
Returns (1)
QWidgetPluginGui
This function yields. It will block the calling thread until completion.

History 5

Tags: [Yields]

CreateToolbar

Parameters (1)
namestring
Returns (1)
PluginToolbar

The CreateToolbar function creates a new PluginToolbar with the given name. The toolbar can then be used to create plugin buttons.

History 5

Deactivate

Parameters (0)
No parameters.
Returns (1)
null

Deactivates the plugin. This will disengage the associated PluginMouse if it has been activated

See also:

History 3

Deactivation

Parameters (0)
No parameters.

Fired when the Plugin is deactivated. This occurs when either the plugin code calls Plugin:Deactivate(), or because some other plugin called Plugin:Activate(), which forces all other plugins to lose their active state.

See also:

  • Plugin.Unloading, fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating

History 4

DisableUIDragDetectorDrags

TypeDefault
bool

History 1

GetItem

Parameters (2)
keystring
defaultValueVariant
Returns (1)
Variant

History 8

GetJoinMode

Parameters (0)
No parameters.
Returns (1)
JointCreationMode

Returns the JointCreationMode the user has set in studio under the Model tab.

History 2

GetMouse

Parameters (0)
No parameters.
Returns (1)
PluginMouse

GetMouse returns a PluginMouse that can be used while the plugin is active through Plugin:Activate().

History 5

GetPluginComponent

Parameters (1)
namestring
Returns (1)
Variant
This function has a custom internal state. It may behave in a non-standard way.

History 2

Tags: [CustomLuaState]

GetSelectedRibbonTool

Parameters (0)
No parameters.
Returns (1)
RibbonTool

GetSelectedRibbonTool return the currently selected RibbonTool. It returns an Enum that corresponds to a particular tool. This will return whether the tool is selected manually or programmatically via Plugin:SelectRibbonTool().

History 2

GetSetting

Parameters (1)
keystring
Returns (1)
Variant

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.

History 4

GetStudioUserId

Parameters (0)
No parameters.
Returns (1)
int64

Returns the studio user's userId if they're logged in, otherwise returns 0.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 6

Tags: [Deprecated]

GetUri

Parameters (0)
No parameters.
Returns (1)
Dictionary

History 1

GridSize

TypeDefault
float

Returns the grid snapping size the user has set in Studio under the Model or Avatar tabs. Note that this property may have slight rounding errors; for example it may be 0.0099999997764826 for a user setting of 1 or 0.4000000059604645 for a user setting of 0.4.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 4

Tags: [ReadOnly, NotReplicated]

ImportFbxAnimation

Parameters (2)Default
rigModelInstance
isR15booltrue
Returns (1)
Instance

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.

This function yields. It will block the calling thread until completion.

History 5

Tags: [Yields]

ImportFbxRig

Parameters (1)Default
isR15booltrue
Returns (1)
Instance

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.

This function yields. It will block the calling thread until completion.

History 9

Tags: [Yields]

Intersect

Parameters (1)
objectsInstances
Returns (1)
Instance

History 2

Invoke

Parameters (2)
keystring
argumentsTuple
Returns (1)
null

History 5

IsActivated

Parameters (0)
No parameters.
Returns (1)
bool

This function returns true if this plugin is currently active, after having been activated via the Plugin:Activate() function.

History 2

IsActivatedWithExclusiveMouse

Parameters (0)
No parameters.
Returns (1)
bool

This function returns true if this plugin is currently active with an exclusive mouse, after having been activated via the Plugin:Activate() function. If this returns true, a PluginMouse can be retrieved via Plugin:GetMouse().

See also:

  • Plugin.Deactivation, fires when the plugin is deactivated
  • Plugin.Unloading, fires immediately before the plugin is unloaded or reloaded via uninstallation, deactivation, or updating

History 2

Negate

Parameters (1)
objectsInstances
Returns (1)
Instances

Negates the given parts and returns the resulting NegateOperations.

History 4

OnInvoke

Parameters (2)
keystring
callbackFunction
Returns (1)
Instance

History 4

OnSetItem

Parameters (2)
keystring
callbackFunction
Returns (1)
Instance

History 4

OpenScript

Parameters (2)Default
scriptLuaSourceContainer
lineNumberint1
Returns (1)
null

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.

History 7

OpenWikiPage

Parameters (1)
urlstring
Returns (1)
null

Opens the context help window to the wiki page that url links to.

History 3

PauseSound

Parameters (1)
soundInstance
Returns (1)
null

History 4

PlaySound

Parameters (2)Default
soundInstance
normalizedTimePositiondouble0
Returns (1)
null

History 5

ProcessAssetInsertionDrag

Parameters (3)
assetIdstring
assetTypeIdint
instancesInstances
Returns (1)
Instances

History 3

Tags: [NoYield]

ProcessAssetInsertionDrop

Parameters (0)
No parameters.
Returns (1)
null

History 2

Tags: [NoYield]

PromptForExistingAssetId

Parameters (1)
assetTypestring
Returns (1)
int64

Opens a window in Roblox Studio, which prompts the user to select an asset based on the assetType specified. Returns what assetId was selected, or -1 if the window was closed.

This function yields. It will block the calling thread until completion.

History 5

Tags: [Yields]

PromptSaveSelection

Parameters (1)Default
suggestedFileNamestring
Returns (1)
bool

Prompts the user to save their current selection with the specified file name. Returns true if the user did save the file.

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

Ready

Parameters (0)
No parameters.

History 1

ResumeSound

Parameters (1)
soundInstance
Returns (1)
null

History 4

SaveSelectedToRoblox

Parameters (0)
No parameters.
Returns (1)
null

Opens an upload window for the user's current selection.

History 5

SelectRibbonTool

Parameters (2)
toolRibbonTool
positionUDim2
Returns (1)
null

Activates the specified Roblox Studio tool. If the tool opens a window, the position parameter specifies where it should be shown on the screen.

Note:

  • An object must be selected in order for this to work correctly.
  • Altering the scale fields of the position property will not affect the dialog popups.

History 3

Separate

Parameters (1)
objectsInstances
Returns (1)
Instances

Separates the given UnionOperations and returns the resulting parts.

History 4

SetItem

Parameters (2)
keystring
valueVariant
Returns (1)
null

History 8

SetReady

Parameters (0)
No parameters.
Returns (1)
null

History 2

SetSetting

Parameters (2)
keystring
valueVariant
Returns (1)
null

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 Plugin:GetSetting().

History 5

StartDecalDrag

Parameters (1)
decalInstance
Returns (1)
null

History 3

StartDrag

Parameters (1)
dragDataDictionary
Returns (1)
null

StartDrag initiates a drag action using a dictionary of parameters. The parameters are as follows:

NameTypeDefaultDescription
Senderstring""Identifies the source of the drag action to the drop target
MimeTypestring""The MIME type of Data.
Datastring""Information about the drag action, for example what is being dragged. Should be used by the drop target.
MouseIconContent""The icon to use for the mouse cursor during the drag. If empty, uses the default cursor.
DragIconContent""An image to render under the mouse cursor during the drag. This should represent the item being dragged.
HotSpotVector2Vector2.new(0, 0)The pixel offset from the top-left where the cursor should "hold" the DragIcon.

See also:

History 5

StopAllSounds

Parameters (0)
No parameters.
Returns (1)
null

History 3

Union

Parameters (1)
objectsInstances
Returns (1)
Instance

Unions the given parts and returns the resulting UnionOperation.

History 3

Unloading

Parameters (0)
No parameters.

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.

History 2

Removed members 7

Bind

Parameters (2)
keystring
callbackFunction
Returns (1)
Instance

History 4

  • 408 Remove Bind
  • 407 Change Security of Bind from PluginSecurity to RobloxScriptSecurity
  • 400 Change Security of Bind from RobloxScriptSecurity to PluginSecurity
  • 398 Add Bind

BindAndFire

Parameters (2)
keystring
callbackFunction
Returns (1)
Instance

History 4

CreatePluginGui

Parameters (3)
pluginGuiNamestring
restoreEnabledStatebool
initialEnabledStatebool
Returns (1)
Instance

History 3

Fire

Parameters (2)Default
keystring
valuestring
Returns (1)
void

History 4

  • 408 Remove Fire
  • 407 Change Security of Fire from PluginSecurity to RobloxScriptSecurity
  • 400 Change Security of Fire from RobloxScriptSecurity to PluginSecurity
  • 398 Add Fire

HasItem

Parameters (1)
keystring
Returns (1)
bool

History 4

MDIInstance

TypeDefault
MDIInstance
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 4

Tags: [ReadOnly, NotReplicated]

RemoveItem

Parameters (1)
keystring
Returns (1)
bool

History 4

Settings