I solved this issue myself, no help is needed
I was making a script that limits the amount of items a player can have in their backpack, and I was going to do this by force dropping whatever item they just picked up if they have the max number of items in their inventory. However, I don't know how to force drop an item that the player just picked up.
My script looks like this:
limit = 2
game.Players.PlayerAdded:Connect(function(p)
p.Backpack.ChildAdded:Connect(function(tool)
local items = p.Backpack:GetChildren()
if #items == limit then
-- force drop item
end
end)
end)
Any help is appreciated!

1 comment
Bro, as soon as I post my answer, you solved it yourself lol