Can I make a plugin checks a selected thing?

Hello!
I am new to making plugins

I just want to know if can plugins check a selected thing?
I tried finding it…
I was going to make a plugin today and I wanted to know if they can do that

How can I use that? (30 limit)

Yes, they can.

game.Selection:Get() returns a table of the selected items, with the first keys being the first selected.

Example, if you want to make all the selection red, then you would do:

function attemptToColor(instance)
	if instance:IsA("BasePart") then
		instance.Color = Color3.fromRGB(255,0,0)
	end
end

for k,n in pairs(game.Selection:Get()) do
	attemptToColor(n)
	for i,v in pairs(n:GetDescendants()) do
		attemptToColor(v)
	end
end

I recommend you look at a plugin guide. If you don’t know how to use a table, then you should look at that too, before working with plugin scripts.

thank you man! (AAAAAAAAAA 30 limit)