I have a script that when a button is clicked it opens a menu and changes the toggle button's position so that it is visible but changes the position to the top left corner instead of above the menu, how do i fix it?
Openpos = UDim2.new({8.39, 0},{0.543, 0}) ClosePos = UDim2.new({8.39, 0},{0.922, 0}) MenuOpen = false MenuButton = script.Parent.MenuToggle MenuFrame = script.Parent.MenuFrame MenuButton.MouseButton1Click:Connect(function() if MenuOpen then MenuOpen = false MenuButton.Position = ClosePos MenuButton.Text = "Open Menu" MenuFrame.Visible = false elseif not MenuOpen then MenuOpen = true MenuButton.Position = Openpos MenuButton.Text = "Close Menu" MenuFrame.Visible = true end end)
You need to take the {} out of the positions. it should just be 4 numbers.
Openpos = UDim2.new(8.39, 0,0.543, 0) ClosePos = UDim2.new(8.39, 0,0.922, 0)