How do I disable the inventory?

How do I completely disable a player’s inventory? (Like when you press the keybind the inventory UI won’t show up)

1 Like

It works in a similar way since you’re disabling a part of the CoreGui, but it’s not through SetCore – instead, it uses SetCoreGuiEnabled:

-- LocalScript Code
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

Resources

List of CoreGui types - Creator Documentation
SetCoreGuiEnabled - Creator Documentation


Post Edits Changelog

Edit #1 (May 20th, 2022) – Updated the Roblox Developer Hub Documentation links throughout this post to the new Creator Documentation pages.

Because the Roblox Developer Hub will be superseded by Roblox’s Creator Documentation, I figured that it would be better to replace the links in this post sooner rather than later so that the main post wouldn’t have broken links in the far future.

Before

CoreGuiType - Developer Hub Documentation
SetCoreGuiEnabled - Developer Hub Documentation

After

CoreGuiType - Creator Documentation
SetCoreGuiEnabled - Creator Documentation

19 Likes