How do you delete and readd the chat box?

How do you make it where the chat box where you would chat gets disabled/deleted with a command, but it gets readded/enabled with another command?

What you are looking for is the SetCoreGui command. Chat box is part of the coregui. The code would look like this:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false) --disables chat for the player