Hi guys! I made this code:
script.Parent.Size.X = UDim.new(1/4.5,0) script.Parent.Size.Y = UDim.new(0,script.Parent.AbsoluteSize.X) script.Parent.Position = UDim2.new(0,script.Parent.AbsoluteSize.X/2,0,1/45)
And I got this Output error:
00:41:16.160 - X cannot be assigned to 00:41:16.161 - Script 'Players.Player.PlayerGui.MenuGui.Frame.Frame.ImageLabel.LocalScript', Line 1 00:41:16.161 - Stack End
Why? What I wanted to do is that a gui is a scaled square (That means it shows up as a square on any screen size) and a tenth of it's size away from the parenting frame.
script.Parent.Size = UDim2.new(1/4.5,0,0,script.Parent.AbsoluteSize.X) script.Parent.Position = UDim2.new(0,script.Parent.AbsoluteSize.X/2,0,1/45)
ROBLOX Lua doesn't let you edit the X without changing everything else. So you have to do double the work and edit the Y too & Vice Versa.
The X and Y value of the size is a final property, it can't be changed but can only be read. But if it did work you were doing it wrong anyway. X and Y has 2 properties called Offset and Scale. You didn't specify which. The only way to change the size of a 2D element is by using UDim2.new().