How do I lock controls until the gui is finished and becomes not visible?

How do I lock controls until GUI is finished, like a click play GUI until you click it and it disappears controls don’t work?
Not sure how to do this if you know how please tell me the code?

Found an already made topic explaining how to disable control input.

Oh okay, I didn’t see that, thank you for telling me this!