This member cannot be used in scripts, but is usable in the command bar and plugins.
Returns an array of currently selected
Instances in Roblox Studio.
Instances are selected, the array returned be empty. This function can be used in conjunction with the
Selection/SelectionChanged event to get the selection whenever it changes.
Note, this function can only be used in
Plugins or the command line.
For changing the current selection, please see
An array of currently selected
The following code sample, when used in a plugin or the command bar, will rotate currently selected
local Selection = game:GetService("Selection") for _, object in pairs(Selection:Get()) do if object:IsA("BasePart") then object.CFrame = object.CFrame * CFrame.Angles(0, math.pi / 2, 0) end end
This example prints the number of selected items whenever SelectionChanged is fired: