I'm trying to make a configuration for a phone that will change the size, position, and change the button's text. Nothing changes at all.
local value = script.Parent.Clicks local text = script.Parent local phone = script.Parent.Parent.PhoneTemplate text.MouseButton1Click:Connect(function() value.Value = value.Value + 1 end) value.Changed:Connect(function(new) if new == 1 then text.Text = "Width (1/3)" phone.Size = {0, 250},{0, 396} phone.Position = {0.4, 0},{0.19, 0} --Poisition is here because without it the screen would get messed up elseif new == 2 then text.Text = "Width (2/3)" phone.Size = {0, 260},{0, 396} phone.Position ={0.396, 0},{0.19, 0} elseif new == 3 then text.Text = "Width (3/3)" phone.Size = {0, 270},{0, 396} phone.Position = {0.394, 0},{0.19, 0} elseif new > 3 then text.Text = "Width (1/3)" value.Value = 1 end end)
Thanks if you can help.
That's not how you set position. You need to use UDim2
for it.
local value = script.Parent.Clicks local text = script.Parent local phone = script.Parent.Parent.PhoneTemplate text.MouseButton1Click:Connect(function() value.Value = value.Value + 1 end) value.Changed:Connect(function(new) if new == 1 then text.Text = "Width (1/3)" phone.Size = UDim2.new(0, 250, 0, 396) phone.Position = UDim2.new(0.4, 0, 0.19, 0) elseif new == 2 then text.Text = "Width (2/3)" phone.Size = UDim2.new(0, 260, 0, 396) phone.Position =UDim2.new(0.396, 0, 0.19, 0) elseif new == 3 then text.Text = "Width (3/3)" phone.Size = Udim2.new(0, 270, 0, 396) phone.Position = UDim2.new(0.394, 0, 0.19, 0) elseif new > 3 then text.Text = "Width (1/3)" value.Value = 1 end end)