Apparently, I can't compare a coordinate of a UDim2 value, so how would I do something similar to this?:
repeat wait (.1) gui.Frame.Position = new.Frame.Position - UDim2.new (0,0,.041,0) -- subtracts slowly until gui.Frame.Position.Y <= .18 -- until it reaches a limit
All help is appreciated.
You can compare the coordinates of a UDim2.
However, if we look at the documentation we see that Y
is not a number, but a UDim
.
UDim
have number properties Scale
and Offset
. Since you're modifying the scale here, you'd use Position.Y.Scale <= .18
instead.
Try this instead:
repeat wait (.1) gui.Frame.Position = UDim2.new (gui.Frame.Position.X.Scalegui.Frame.Position.X.Offset,gui.Frame.Position.Y.Scale-.041,gui.Frame.Position.Y.Offset) until gui.Frame.Position.Y.Scale <= .18