I recently created a plugin for me with a lot of cool tools.
One of them is a gui object converter. We all realized that the image we placed perfectly had to be an imagebutton. My tool allows you to replace it in one click !
But a problem persists !
When I click on the buttons of my gui, I lose my selection (look down below) and my script therefore does not detect the frames that I have to replace
The only possible solution here would be to detect selection changes, and save it as a variable. Then check if that selected instance is a valid UI Object, then boom!
For example:
local Selection = game:GetService("Selection")
local lastSelection
Selection.SelectionChanged:Connect(function()
lastSelection = Selection:Get()
end)
Button.MouseButton1Click:Connect(function()
--loop through last selection and convert!
end)
Hope this helps. I’ve had similar issues, but with a sort of radio system.