function C(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
script.Parent.Parent.Classes.Backing.Visible = true
print("C")
else
if script.Parent.Backing.Visible == true then
script.Parent.Parent.Classes.Backing.Visible = false
end
end
end
game.ContextActionService:BindActionToInputTypes("keyPress", C, false, Enum.KeyCode.C)
When I press the letter C the GUI pops up but then it closes instantly. How would I toggle the GUI so that when I press it the GUI stays up and if I press C when the GUI is up the GUI will Close?

3 comments
the 7th line has an error after you remove the dot on line 3 because the dot in not needed
fixed
Thx