How do I set the value to GUI offset?
if script.Parent[""..number.Value].Position.X.Offset > 40 then script.Parent[""..number.Value].Position.X.Offset = 40 ---It wont let me do this end
I cant use UDIM2.new because that involves Y axis variables, but this system works on more then one frame with different Y positions. And I can't use + UDIM2.new because it's not always the exact same value over 40 every time.
You can pass in the untouched portions of the current UDim2 when you create a new one to replace it.
Also, you don't have to concatenate to an empty string.
local pos = script.Parent[number.Value].Position --for less typing script.Parent[number.Value].Position = UDim2.new(pos.X.Scale, 40, pos.Y.Scale, pos.Y.Offset)