I made a tweening so I could open and close my team gui like a shop gui, but it won't work. Why? Much appreciated for help.
local mainFrame = game:GetService("StarterGui").teamGUI.MainFrame local visibilityBtn = game:GetService("StarterGui").teamGUI.MainFrame.visibilityBtn visibilityBtn.MouseButton1Click:Connect(function() if mainFrame.Position == UDim.new(0.5,0,0.5,0) then mainFrame:TweenPosition(UDim2.new(-0.16,-3,0.5,0), "In Out", "Sine") visibilityBtn.Text = "CLOSE" end if mainFrame.Position == UDim.new(-0.16,-3,0.5,0) then mainFrame:TweenPosition(UDim2.new(0.5,0,0.5,0), "In Out", "Sine") visibilityBtn.Text = "OPEN" end end)
You shouldn't do StarterGUI. All items in StarterGUI go directly into a player's PlayerGui. I recommend you put the script in the frame or button and change it to stuff like -
local visibilityBtn = script.Parent visibilityBtn.MouseButton1Click:Connect(function() -- Code end)