I'm trying to make a part that sets it's X and Y size to another part's X and Y size.
local buildings = workspace.Buildings:GetChildren() local roofs = Instance.new("Folder", workspace) for i = 1,#buildings do local roof = Instance.new("Part", roofs) roof.Size.X = buildings[i].Size.X roof.Size.Z = buildings[i].Size.Z end
Error = X cannot be assigned to
Why isn't it changing the X and Z size of the part
to the X and Z size of the building[i]
?
Any help or tip appreciated !
You can't change only X,Y or Z. Use Vector 3 to set the size.
local buildings = workspace.Buildings:GetChildren() local roofs = Instance.new("Folder", workspace) for i = 1,#buildings do local roof = Instance.new("Part", roofs) roof.Size = Vector3.new(buildings[i].Size.X,roof.Size.Y,buildings[i].Size.Z) end