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

Frame keeps moving when its supposed to stop?

Asked by 9 years ago

I don't know why. I did everything like its supposed to be like.

Script:

script.Parent.MouseButton1Click:connect(function()
    repeat
        wait(0.000000000000000000000000000000000000000000000000001)
        script.Parent.Parent.Frame.Position = script.Parent.Parent.Frame.Position + UDim2.new(0,5,0,0)
    until script.Parent.Parent.Frame.Position == UDim2.new(0,200,0,100)
end)

lol ignore the wait(0.000000000000000000000000000000000000000000000000000001)

1
the wait() function has a limit, you know. 0.03 seconds. You can just use wait() to get the same result. aquathorn321 858 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

You keep adding 5 to the X Offset, but you're checking if the X Offset is 200 AND the Y Offset is 100, but the Y Offset never reaches 100?

Change line 5 to

until script.Parent.Parent.Frame.Position.X.Offset >= 200
0
thx Operation_Meme 890 — 9y
Ad

Answer this question