Hello, I’m trying to achieve an autoscale size and positioning, meaning of this is whenever you add a frame to a screen GUI inside a frame or anything instead of it starting as offset on size or position it gets automatically converted to scale.
Note – This is a plugin
But my issue is whenever I move the GUI object it fires like a hundred times. here is my code.
game.DescendantAdded:Connect(function(descendant)
if descendant:IsA("GuiObject") and AutoSS then
print("Test")
game.Selection:Add({descendant})
AutoScale.SetSize("Scale")
game.Selection:Remove({descendant})
end
if descendant:IsA("GuiObject") and AutoPS then
print("Test")
game.Selection:Add({descendant})
AutoScale.SetPos("Scale")
game.Selection:Remove({descendant})
end
end)
Hello, i dont really understand what you meant by highlighted?
if you talking about the resize buttons when you select a frame or something they move with the frame but it is very laggy and is going behind.
I believe the imagelabel and the dropshadow stuff are the things that come when you click on the frame “as you said” highlighted I think
When you move the GUI does it change at all, like when you mouse over some items the images goes lighter or darker or the border changes (highlighting it). That would probably add a descendant.
If so can you not just put a line after like if descendant == those items then end
I fixed it, instead of doing a game.DescendantAdded I would choose workspace and startergui since if I only do game it will also detect coregui and the Roblox highlight when you select a GUI object to like resize will get detected this is why I get this error.
You were checking for game.DescendantAdded:Connect(function(descendant)
Your complaint was that that function is firing multiple times.
My comment was to check what descendant was being added.
I didn’t notice you were using game.DescendantAdded. If I did I would have said you should change that to check the Descendant of only the item you want to have the script check for.