I try to do it but it remove the items.
You would use SetCoreGui
.
If you wanted to remove the Backpack, I think it would go like this:
local sg = game.StarterGui sg:SetCoreGuiEnabled(2, false)
This can only be done through a LocalScript however.
For the list of available CoreGui's, and there Enum, go here.