How do i can make UI Button and Show Another UI like Setting or like that

I watch Youtube Teach Script but i don’t get what i wrong?

Code:

local open = true

script.Parent.MouseButton1Click:Connect(function()
	if open == true then 
		open = false
		script.Parent.Parent.Parent.GUI1.ACHIEVEMENTS:TweenPosition(UDim2.new(0, 0,0, 0) "Inout" , "Quad", 0.5, true)
	else
	    open = false
	    script.Parent.Parent.Parent.GUI1.ACHIEVEMENTS:TweenPosition(UDim2.new(0, 0,1.5, 0) "Inout" , "Quad", 0.5, true)
	end
end)

Thank you Ya’ll!

The open boolean is turned on false and never true again.

image

You are missing the separators of , between UDim2.new() and other parameters.

1 Like