Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I replace this?

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.

1 comment

0

Umm...I'm a little lost at what you're attempting. I see a few errors but...what exactly is this SUPPOSED to be? Just moving the gui up right?

2 answers

✓ Accepted answer

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.

1 comment

0

Wow. I, again, am made to look foolish. I guess that's a risk we all take when asking for help. Thanks, BlueTaslem!

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

2 comments

0

Points for also providing the right answer.

0

Not points for giving no explanation..

This discussion is preserved as it was. New answers, comments, and votes are closed.