How do I make it so that the player's inventory doesn't show up on top of the loading screen until the play button is pressed?

I made a gui that closes when you press play but the gear in the player’s inventory shows up on top of it. Is there any way to hide them until play is pressed?

Use this code:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Inventory,false)

Button.MouseButton1Down:Connect(function()
      StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Inventory,true)
end)

Keep in mind that if you want your game to mobile-compatible, it needs UIS.

Thank you, where do I put this scriptt?

You would want that script to run on the player’s client, therefore you would put it inside a LocalScript, and then put that localscript inside either StarterGui, StarterPack, or StarterPlayerScripts.

1 Like