CreatePluginAction
This member cannot be used in scripts, but is usable in the command bar and plugins.
For thread safety, this property is not safe to read in an unsynchronized thread.
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
articles/Intro to Plugins
, an introductory article to plugin use and developmentPluginMenu
, a context menu that can be shown in Studio which displays a list of PluginActions and supports submenusPlugin/CreatePluginMenu
, creates a PluginMenu
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
Must be a unique string that identifies this PluginAction from others |
||
|
The displayed name of the action |
||
|
The displayed description of the action |
||
|
The name of the icon used to display the plugin |
||
true
|
Whether the |
Returns
Return Type | Summary |
---|---|
Code Samples
Creating a PluginAction
This code sample visualizes how to create a PluginAction
. Plugin actions must be created using the Plugin/CreatePluginAction
function in order to work.
In order to work as expected, the code block must but pasted into the command bar, but only once. Consecutive attempts at executing the code in the command bar will result in an error because a plugin cannot create more than one PluginAction with the same id.
After executing the code, the newly created action can be assigned a keyboard shortcut under File → Advanced → Customize Shortcuts…
, and can also be added to the Quick Access Toolbar.
When the created action is bound and PluginAction/Triggerd|triggered
, it prints “Hello world!” in the output window.