local i2 = script.Parent
local i1 = script.Parent.Parent.ImageButton1
local i3 = script.Parent.Parent.ImageButton3
local frame1 = script.Parent.Parent
local frame2 = script.Parent.Parent.Parent.Frame2
function onClick(i2)
for i = -0.1,200 do
i1.Position = i1.Position + UDim2.new(0,-0.1,0,0)
wait(0.12)
end
end
i2.MouseButton1Click:connect(onClick)
COMMUNITY QUESTION
How can i add until "x" reaches -200?
1 answer
Try this.
local i2 = script.Parent
local i1 = script.Parent.Parent.ImageButton1
local i3 = script.Parent.Parent.ImageButton3
local frame1 = script.Parent.Parent
local frame2 = script.Parent.Parent.Parent.Frame2
function onClick(i2)
repeat
i1.Position = i1.Position + UDim2.new(0,-0.1,0,0)
wait(0.12)
until i1.Position >= -200
end
i2.MouseButton1Click:connect(onClick)
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
I don't understand your question, what is 'equalize'?
I want to add a higher value to x, but i don't know how, i'm just saying make it -0.1 instead of from -0.1 to all they way to -200
???
I'm loosing Rep because nobody understand what i'm saying, i want to increase the "x" value from -0.1 to -200, ALL THE WAY.
Then why not just do '...UDim2.new(0,-200,0,0)'?
I want the code to execute 200 times per each 0.12 seconds while adding -0.1 to the "x" value till it reaches -200
I'm pretty sure the shortest amount of wait() time is 30 times a second. I don't think it's possible to do it 200 times in .12 seconds.