Player can still equip items with numbers even though backpack is disabled

I want to completely disable the backpack

The problem is that if you press a number which belongs to an item in the toolbar it will still equip it.

I looked for it but I could only find the thing with disable the core gui. That thing makes it invisible but does not disable the number equipping.

This is what I have:

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

Thanks!

1 Like

use Humanoid:UnequipTools

https://developer.roblox.com/en-us/api-reference/function/Humanoid/UnequipTools

1 Like

That will only unequip them once I want them to be completely unable to equip it until I reactivate it.

what, how?

Are they using exploits, I am sure you cant equip any tools because the backpack GUI is disabled

Well I can for some reason. Im testing it in studio, has nothing to do with exploiting

Ima just loop the unequip function it will be alright. Thanks

Here, try this out:

local PS = game:GetService("Players")

local player = PS.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum: Humanoid = char:WaitForChild("Humanoid")

for _,v: Tool in ipairs(player.Backpack:GetChildren()) do
	if v:IsA("Tool") then
		v.Equipped:Connect(function()
			task.wait()
			hum:UnequipTools()
		end)
	end
end
1 Like
local Character = nil --Reference to the player's character.
local Humanoid = nil --Reference to the character's humanoid.

local function OnChildAdded(Child)
	if not (Child:IsA("BackpackItem")) then return end --Base class for tools/hoppers etc.
	task.wait() --Necessary evil.
	Humanoid:UnequipTools()
end

Character.ChildAdded:Connect(OnChildAdded)
1 Like