Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Size of gui not changing??

Why won't it change the shape of a gui when you click on the gui button??? Please help!

function onClick(mouse)
	script.Parent.Parent.Parent.Frame.OPEN.Size.X.Offset ="75"
end

script.Parent.MouseButton1Click:connect(onClick)

2 answers

To explain SolarWind's answer: you cannot set the individual members of an Object's property, you have to set the whole property at once. A GUI's Size property is a UDim2 data type, you you have to use that.

To only change one property, you have to be to be more careful than what Solar did as well:

local bin =  script.Parent.Parent.Parent.Frame.OPEN
function onClick(mouse)
   bin.Size = UDim2.new(bin.X.Scale, 75, bin.Y.Scale, bin.Y.Offset)
end

script.Parent.MouseButton1Click:connect(onClick)

Changing the GUI's size to ({0, 75};{0, 0}) has the problem of having absolutely no height.

This discussion is preserved as it was. New answers, comments, and votes are closed.