If I do this:
function GUIChanger(GUI) GUIx = GUI.Size.X GUIy = GUI.Size.Y --This wont work: GUIx = GUIx+1 end --Giving the GUI: GUIChanger(StarterGui.GUI.Button)
This wont work because the GUIx value ends up being: {Value,Value}, Both offset and scale, How would I make these separate?
You'd have to use UDim2.new(). For example,
local x = GUI.Size.X.Scale + 1 local y = GUI.Size.Y.Scale local xoffset = GUI.Size.X.Offset local yoffset = GUI.Size.Y.Offset UDim2.new(x, xoffset, y, yoffset)
You have to use UDim2(XScale,XOffset,YScale,YOffset)
rather than X and Y.
Therefore, this is a working script:
local GUI = game.StarterGui.ScreenGui.Frame --change this to whatever gui you want function GUIChanger() local newSize = UDim2.new(0,0,0,0) --change this to whatever size you want GUI.Size = newSize end GUIChanger(StarterGui.GUI.Button)
Hope this helps!
-Maxis_s