Properties
string
[NotReplicated]
|
The icon to be displayed when used as a sub menu |
string
[NotReplicated]
|
The text to be displayed when used as a sub menu |
bool
|
Determines if an |
string
[ReadOnly]
[NotReplicated]
|
A read-only string representing the class this |
int
[Hidden]
[ReadOnly]
[NotReplicated]
[Deprecated]
|
The cost of saving the instance using data persistence. |
string
|
A non-unique identifier of the |
Instance
[NotReplicated]
|
Determines the hierarchical parent of the |
bool
[Hidden]
|
A deprecated property that used to protect |
bool
[Hidden]
[NotReplicated]
[Deprecated]
|
string
[ReadOnly]
[NotReplicated]
[Deprecated]
|
Functions
void
|
Adds the given action to the menu |
void
|
Adds the given menu as a separator |
Instance
|
Creates a temporary action that is hidden from Studio’s customize shortcuts window
See also
|
void
|
Adds a separator between items in the menu |
void
|
Clears the menu |
Instance
[Yields]
|
Shows the menu at the mouse cursor. Yields until either an item is selected or the menu is closed |
void
|
This function destroys all of an |
Instance
|
Create a copy of an object and all its descendants, ignoring objects that are not |
void
|
Sets the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Variant
|
Returns the attribute which has been assigned to the given name |
RBXScriptSignal
|
Returns an event that fires when the given attribute changes |
Dictionary
|
Returns a dictionary of string → variant pairs for each of the |
Objects
|
Returns an array containing all of the |
string
[NotBrowsable]
|
Returns a coded string of the |
Array
[CustomLuaState]
|
Returns an array containing all of the descendants of the instance |
string
|
Returns a string describing the |
RBXScriptSignal
|
Get an event that fires when a given property of an object changes. |
bool
[CustomLuaState]
|
Returns true if an |
bool
|
Returns true if an |
bool
|
Returns true if an |
void
[Deprecated]
|
Sets the object’s Parent to nil, and does the same for all its descendants. |
void
|
Sets the attribute with the given name to the given value |
Instance
[CustomLuaState]
[CanYield]
|
Returns the child of the |
Objects
[Deprecated]
|
Returns an array of the object’s children. |
Instance
[Deprecated]
|
void
[Deprecated]
|
Instance
[Deprecated]
|
Objects
[Deprecated]
|
bool
[Deprecated]
[CustomLuaState]
|
bool
[Deprecated]
|
void
[Deprecated]
|
Events
RBXScriptSignal
|
Fires when the |
RBXScriptSignal
|
Fires whenever an attribute is changed on the |
RBXScriptSignal
|
Fired immediately after a property of an object changes. |
RBXScriptSignal
|
Fires when an object is parented to this |
RBXScriptSignal
|
Fires when a child is removed from this |
RBXScriptSignal
|
Fires when a descendant is added to the |
RBXScriptSignal
|
Fires immediately before a descendant of the |
RBXScriptSignal
[Deprecated]
|
Code Samples
Creating a PluginMenu and PluginMenuAction
This code sample visualizes how PluginMenu|PluginMenus
and PluginAction|PluginActions
behave when created for a Plugin
. Outside of this example, you should not parent the plugin or its functional components to the game’s workspace.
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 PluginMenu with the same id.
After executing the code, changing the created BoolValue
in the game’s workspace via the Explorer window opens the plugin’s menus. Selecting an action from the menus the function connected to the trigger signal.
-- This code can be pasted into the command bar, but only once. local plugin = plugin or getfenv().PluginManager():CreatePlugin() plugin.Name = "Plugin" plugin.Parent = workspace local pluginMenu = plugin:CreatePluginMenu(math.random(), "Test Menu") pluginMenu.Name = "Test Menu" pluginMenu:AddNewAction("ActionA", "A", "rbxasset://textures/loading/robloxTiltRed.png") pluginMenu:AddNewAction("ActionB", "B", "rbxasset://textures/loading/robloxTilt.png") local subMenu = plugin:CreatePluginMenu(math.random(), "C", "rbxasset://textures/explosion.png") subMenu.Name = "Sub Menu" subMenu:AddNewAction("ActionD", "D", "rbxasset://textures/whiteCircle.png") subMenu:AddNewAction("ActionE", "E", "rbxasset://textures/icon_ROBUX.png") pluginMenu:AddMenu(subMenu) pluginMenu:AddSeparator() pluginMenu:AddNewAction("ActionF", "F", "rbxasset://textures/sparkle.png") local toggle = Instance.new("BoolValue") toggle.Name = "TogglePluginMenu" toggle.Parent = workspace local function onToggled() if toggle.Value then toggle.Value = false local selectedAction = pluginMenu:ShowAsync() if selectedAction then print("Selected Action:", selectedAction.Text, "with ActionId:", selectedAction.ActionId) else print("User did not select an action!") end end end toggle.Changed:Connect(onToggled)