Hide Tool Icons on screen?

I have been searching all morning for a simple way to hide all of the tool icons on the screen. I am currently using the default Roblox backpack inventory system, and during certain cut-scenes, or dialog scenes I would like to hide the tool icons at the bottom of the screen.

Every search I do, I keep finding things about hiding the top bar, but nothing about the tool icons, or they bring up ways to disable the backpack when character spawns.
I need a way to toggle the icons at the bottom on and off, if that is possible, without removing everything from the backpack and character, then re-parenting them.

Thanks

7 Likes

For this you can use the :SetCoreGuiEnabled() method of the StarterGui service, which takes care of all core (built-in) UI elements made by roblox, such as the leaderboard, the chat, and like in your case, the inventory.

local CoreGui = game:GetService("StarterGui") --the service

CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) --this is the method disabling the backpack; you can see I set it to false, and chose the backpack
CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false) --you can see you can disable other things, here is all of them https://developer.roblox.com/en-us/api-reference/enum/CoreGuiType

CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) --and you can set it back by replacing false with true
48 Likes

You should use a localscript for cut scenes
i.e to disable all core elements except chat

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
10 Likes

I was under the impression that those commands would only affect how the screen was displayed when the character resets.
So are they able to be called locally on a running character and affect things already in the PlayerGui?

6 Likes

I think that can work, why dont you try it

4 Likes

a local script in StarterPlayerScripts

wait()
pcall(function()
	local starterGui = game:GetService('StarterGui')
	starterGui:SetCore("TopbarEnabled", false)
end)

this will hide EVERYTHING except the age, NAME backpack, chat emotes, everythins except age :slight_smile:

9 Likes

Hey, it seems you’re wanting to set the backpack core gui to false. To do this, you’ll do the following in a local script

local StarterGui = game:GetService("StarterGui")
To hide the tools, use the following line.
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
To show the tools again, use the following line.
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)

6 Likes

I have not been at my office, so I couldn’t try it.

3 Likes

Is there a way to do this but still allow players to press hotkeys to equip their tools?

4 Likes

A hacky way of doing it, if you’re tools dont change, is to have a local script that checks user input, and a script in the character. In the character script, youd have an if statement that checks for player input from a remote function, and if input is 1, then it would force the tool to be held.

Have you tried disabling the gui, and tried to press a hotkey?

4 Likes

Yeah when I use the code and the tools are hidden, the tools don’t pop out pressing 1 - 3 though but I like the solution you gave me, thanks.

4 Likes

I finally had a chance to try the code, and yeah it works anytime, not just when the character is created. So that was my main concern.

I also noticed that tools can not be equipped by keyboard when backpack is hidden, and this is desirable for my purposes.

So thanks for the help.

5 Likes

Making a custom backpack, or simply using Humanoid:EquipTool(objectvalue of a tool) and Humanoid:UnequipTools() I made something similar, let me show you script

repeat wait() until game.Players.LocalPlayer.Character
game:GetService('StarterGui'):SetCoreGuiEnabled('Backpack', false)

local Player = game.Players.LocalPlayer
local Character = Player.Character

local Mouse = Player:GetMouse()

for _,button in pairs(script.Parent:GetChildren()) do
	if button:IsA("ImageButton") then
		Mouse.KeyDown:Connect(function(Key)
			Key = Key:lower()
			if Key == button.TSlot.Text then
				if script.Parent.Visible == true then
					if not Character:FindFirstChild(button.TName.Text) then
						Character.Humanoid:EquipTool(Player.Backpack:FindFirstChild(button.TName.Text))
					elseif Character:FindFirstChild(button.TName.Text) then
						Character.Humanoid:UnequipTools()
					end
				end
			end
		end)
	end
end

3 Likes

Where did you put that script?

1 Like

** EDIT : After looking at the script again, it looks like it would go under a GUI object. One with the buttons for the inventory.

1 Like

where do i put the local script tho?

1 Like

You can put it anywhere a local script can play. Under the Player.Character model, or in a GUI element.

1 Like

Thank You, SelDraken

It worked i had to hide the backpack Gui for my game

1 Like

The following is more of a proxy hide solution in that it allows you to periodically hide/show the names & texture icons of tools while still allowing for those tools to be used.

local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local backpack = player:WaitForChild("Backpack")

local tools = {}

local function hideTools(backpack, humanoid)
	table.clear(tools)
	humanoid:UnequipTools()
	for _, tool in ipairs(backpack:GetChildren()) do
		if tool:IsA("Tool") then
			tools[tool] = {}
			tools[tool].Name = tool.Name
			tools[tool].TextureId = tool.TextureId
			tool.Name = ""
			tool.TextureId = ""
		end
	end
end

local function showTools(backpack, humanoid)
	humanoid:UnequipTools()
	for _, tool in ipairs(backpack:GetChildren()) do
		if tool:IsA("Tool") then
			if tools[tool] then
				tool.Name = tools[tool].Name
				tool.TextureId = tools[tool].TextureId
			end
		end
	end
	table.clear(tools)
end

task.wait(3)
hideTools(backpack, humanoid)
task.wait(3)
showTools(backpack, humanoid)

https://gyazo.com/804bcaee6a027b927d49531d3968125e

1 Like