Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to get selected part/object in studio through a plugin?

Asked by
trecept 367 Moderation Voter
6 years ago

I'm working on my own plugin and I don't know how to get the objects selected in studio explorer (when you click on something in the explorer in studio it highlights blue) when my plugin is clicked. I've tried searching on the wiki but I don't really know what I'm searching for.

1 answer

Log in to vote
4
Answered by
nilVector 812 Moderation Voter
6 years ago

The Get function of Selection will meet your needs.

local selectedObjects= game:GetService("Selection"):Get()

selectedObjects will be a table of Instances that are currently selected by the user.

Ad

Answer this question