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)
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)
function onClick(mouse)
script.Parent.Parent.Parent.Frame.OPEN.Size = UDim2.new(0,75,0,0)
end
script.Parent.MouseButton1Click:connect(onClick)
http://wiki.roblox.com/index.php?title=Tweening http://wiki.roblox.com/index.php/UDim2
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.
2 comments
In the future, please post an explanation along with code.
Ok.