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
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)