local hum = game.Players:FindFirstChild("Humanoid")
local frame = script.Parent:WaitForChild("TextButton").TextButton.Parent.Frame wait() local open = false
script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = false else frame.Visible = false end end)
So when you have an infinite yield when dealing with WaitForChild(""), it's waiting for the child that never comes and so waits infinitely. So TextButton may not be named correctly or in the wrong place, or something with your path is messed up.
In the error the path says Player.Gui.ExitGui.Frame.TextButton:WaitForChild("TextButton") so unless TextButtons Parent is also a TextButton you might just need to say Script.Parent
Otherwise name your buttons better man.