So i got an error I don't know why i want to make max inventory less than 1 tool but this is how it done https://gyazo.com/b45cff28aa8c40fc4a3a1ae46783c22a
The clickdetector script
local items = game.Workspace.Items
local db = false
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if db == false then
db = true
local backpack = plr:WaitForChild("Backpack")
local tool = items.Tool or backpack
if tool then
tool.Parent = backpack
end
end
db = false
end)
And this is the inventory less than 1 tool script
backpack = game.Players.LocalPlayer:WaitForChild("Backpack")
backpack.ChildAdded:Connect(function(child)
local childamount = #backpack:GetChildren()
if childamount > 1 then
for i,tool in pairs(backpack:GetChildren()) do
if tool ~= child then
tool.Parent = game.Workspace.Items
tool.Handle.Position = child.Handle.Position
end
end
end
end)
