local itemsTable =
game.Players.LocalPlayer.Inventory:GetChildren() -- or folder:GetChildren()
local player = game.Players.LocalPlayer
local Enabled = false
game.StarterGui:SetCoreGuiEnabled('Backpack',false)
function UpdateInventory()
if Enabled == false then
Enabled = true
script.Parent.Backpack:ClearAllChildren()
for i,v in pairs(player.Inventory:GetChildren()) do
local Obj1 = Instance.new('TextButton',script.Parent.Backpack)
Obj1.Size = UDim2.new(1,0,0.05,0)
Obj1.BackgroundTransparency = 1
Obj1.TextScaled = true
Obj1.Text = v.Name
Obj1.Font = 'Cartoon'
Obj1.TextColor3 = Color3.new(0,0,0)
Obj1.MouseButton1Down:connect(function()
player.Character.Humanoid:UnequipTools()
player.Character.Humanoid:EquipTool(v)
end)
end
else
Enabled = false
end
end
script.Parent.Parent.Parent.OpenInventory.MouseButton1Down:connect(function()
UpdateInventory()
end)
player.Backpack.Changed:connect(function()
if Enabled == false then Enabled = true UpdateInventory() end
if Enabled == true then Enabled = false UpdateInventory() end
end)
help me i when i use a tool, tool will insta remove

1 comment
wont work its always remove my tools from inventory