Alright so I a making a menu with GUI's and I want to make this button more efficient so I can change it if needed without going through tons of work:
function roll()
script.Parent.Parent.TextBox.Position = UDim2.new(-0.25,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.24,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.23,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.22,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.21,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.20,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.19,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.18,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.17,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.16,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.15,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.14,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.13,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.12,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.11,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.10,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.09,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.08,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.07,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.06,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.05,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.04,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.03,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.02,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(-0.01,0,0.25,0)
wait(0.001)
script.Parent.Parent.TextBox.Position = UDim2.new(0,0,0.25,0)
wait(0.001)
end
script.Parent.MouseButton1Click:connect(roll)

1 comment
Whats the difference between Scale and Offset?