function OpenMenu()
if script.Parent.Parent.Stuff.Visible == false then
script.Parent.Parent.Stuff.Visible = true
wait(.01)
script.Parent.Parent.Stuff:TweenPosition(UDim2.new(0.04, 0,0.3, 0))--{0.9, 0},{-0.1, 0} to {0.04, 0},{0.3, 0}
script.Parent.Parent.Stuff:TweenSize(UDim2.new(0, 200, 0, 300))--{0, 1},{0, 1} to {0, 200},{0, 300}
end
end
function CloseMenu()
if script.Parent.Parent.Stuff.Visible == true then
script.Parent.Parent.Stuff:TweenPosition(UDim2.new(0.9, 0,-0.1, 0))
script.Parent.Parent.Stuff:TweenSize(UDim2.new(0, 1, 0, 1))
wait(0.5)
script.Parent.Parent.Stuff.Visible = false
end
end
script.Parent.MouseButton1Down:connect(OpenMenu)
wait(2)
script.Parent.MouseButton1Down:connect(CloseMenu)
Im new at lua scripting and this script just sometimes pop up instead of smoothly tweening

4 comments
I just noticed i have to debug it but idk how
It's a bad habit to name stuff like "Thingy" and "Stuff". I have no idea what they are supposed to do
@YellowTide I agree since it could be confusing sometime which is why I normally name my functions variables and so on after the function they do.
I fixed it.