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

How do you reverse this?

How would I reverse this Tween so it goes back to the position it was before it was clicked.

bin = script.Parent

function Clicked()
	script.Parent.Parent:TweenPosition
	(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil)
	

wait(3)

bin.Parent.Visible = false

end

bin.MouseButton1Down:connect(Clicked)

1 comment

0

Why do you have 5 values in the UDim2?

1 answer

bin = script.Parent
original = bin.Parent.Position
out = false

function Clicked()
	if out == false then
		script.Parent.Parent:TweenPosition(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil)
		out = true
	else
		script.Parent.Parent:TweenPosition(original, "Out", "Linear", 1, true, nil)
		out = false
	end
end

--[[ I'm not sure where you want to put this stuff....
wait(3)

bin.Parent.Visible = false

]]

bin.MouseButton1Down:connect(Clicked)

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