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

Why won't this tweening work?

Asked by
trogyssy 221 Moderation Voter
10 years ago
db=false 

script.Parent.MouseButton1Click:connect(function()
    if not db then
        db=true 
        script.Parent.Parent:TweenSizeAndPosition(UDim2.new(0, 0, 0, 0), UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 1)
        script.Parent.Parent.Visible=false
        script.Parent.Parent.Parent.Open.Visible=true

        db=false
    end
end)

I've tried changing "Out" to "In", and the EasingStyle, and that's all I could think of trying.

No output, all that happens is "Background" goes invisible and "Open" becomes visible.

Heirarchy:

Gui -Background (Frame) --Close (TextButton) ---Script -Open

1 answer

Log in to vote
3
Answered by
Al1st3r 20
10 years ago
db=false 

script.Parent.MouseButton1Click:connect(function()
    if not db then
        db=true 
        script.Parent.Parent:TweenSizeAndPosition(UDim2.new(0, 0, 0, 0), UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 1)
    wait(1) --Wait, or the code will execute before the tween is finished.
        script.Parent.Parent.Visible=false
        script.Parent.Parent.Parent.Open.Visible=true
        db=false
    end
end)

Ad

Answer this question