Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I replace this?

Asked by
Maxomega3 106
10 years ago

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.

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? dyler3 1510 — 10y

2 answers

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

0
Wow. I, again, am made to look foolish. I guess that's a risk we all take when asking for help. Thanks, BlueTaslem! Maxomega3 106 — 10y
Ad
Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
10 years ago

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
0
Points for also providing the right answer. Maxomega3 106 — 10y
0
Not points for giving no explanation.. BlueTaslem 18071 — 10y

Answer this question