I’m trying to make a script to drop all of the things in my inventory, it works, but only if I’m not using it. Here is the script:
for i,v in pairs(p.Backpack:GetChildren()) do
if v:FindFirstChild("Handle") then
v:Remove()
for i, v in pairs(game.ReplicatedStorage.Folder:GetChildren()) do
v.Parent = workspace
local pos = p.Character.Torso.Position
v.Position = Vector3.new(pos.X,pos.Y, pos.Z + 1.5)
v.Orientation = p.Character.Torso.Orientation
v.SelectionBox.Visible = false
end
else
for i,v in pairs(p.Character:GetChildren()) do
if v:FindFirstChild("Handle") then
v:Remove()
for i, v in pairs(game.ReplicatedStorage.Folder) do
v.Parent = workspace
local pos = p.Character.Torso.Position
v.Position = Vector3.new(pos.X,pos.Y, pos.Z + 1.5)
v.Orientation = p.Character.Torso.Orientation
v.SelectionBox.Visible = false
end
end
end
end
end