How to hide in-game inventory (Backpack)

Hello devs, I need help regarding backpack/starter pack tools.

I’m trying to hide this, while the loading screen loads and I want this to be visible only when the player clicks on the “Deploy”/ " Play" button.

Please help me out. I’m not a coder I mean, I know a bit about local and variables. Please tell me how to do it step by step.

:memo: - Harmony

6 Likes

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) hides the backpack. Replace the false with true to set it back on. Do note that it can only be run locally.

5 Likes

I have done it before on k. TEST world but I can’t remember how I did it I’m sorry I’ll check my coding and get back to you!:grin::video_game:

Hi There!

As @MoaufmKlo said,

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) hides the backpack

You can add a local script inside of the Starter Gui:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

This will keep it on false initially when a player joins, the tools will be hidden.

Add another Local Script inside of the “Deploy/Play” button or TextButton Gui, add an event that fires when the button is pressed that will replace false with true:

script.Parent.MouseButton1Click:Connect(function() --Parent is the TextButton here
    	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
end)

So when a player clicks on the “Deploy/Play” button, the tools will appear.
And you can also add another code to destroy the first LocalScript so it won’t hide the tools again when a player resets (if the player is not required to press the Play button again).

script.Parent.Parent.LocalScript:Destroy() -- LocalScript is the first script with one line of code

Hope this helps!

9 Likes