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

script not working right.. ?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

its not going up slowly it going up whole

    script.Parent.button.MouseButton1Up:connect (function ()
for i = 0,1 do
    wait(0.1)
    script.Parent.Frame.ImageLabel.Size = UDim2.new(1, 0, 0. -i, 0)
    --wait(5)
    --script.Parent.Frame.ImageLabel.Size = UDim2.new(1, 0, 0, 0)
end
end)

2 answers

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

As an alternative, you can use the TweenSize method of GUI objects:

script.Parent.button.MouseButton1Up:connect (function ()
    script.Parent.Frame.ImageLabel:TweenSize(UDim2.new(1, 0, -1, 0), "Out", "Quad", 1, true)
    --The true at the end lets you 'override' this Tween with another Tween if you expect one to occur.
end)

Ad
Log in to vote
0
Answered by 10 years ago

You are going up only by 1. So Instantly you will hit your destination. You should try

    script.Parent.button.MouseButton1Up:connect (function ()
for i = 0,1,0.1 do
    wait(0.1)
    script.Parent.Frame.ImageLabel.Size = UDim2.new(1, 0, 0. -i, 0)
    --wait(5)
    --script.Parent.Frame.ImageLabel.Size = UDim2.new(1, 0, 0, 0)
end
end)

All I did is add "0.1" to the end of "for i = 0,1" This is to tell the script to count by 0.1, Automatically it counts by 1. Also It will stop at 1 because you've assigned it to only go to 1.

0
thank you Layfonex 0 — 10y

Answer this question