Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't this tweening work?

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

✓ Accepted answer
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)

This discussion is preserved as it was. New answers, comments, and votes are closed.