How do I limit the player's inventory to one item?

if pUp.powerUpType.Value == "Weapon" and #plr.Backpack:GetChildren() == 0 then

This is my current code. It works exactly as it should, except there’s one problem with it: When you equip an item, it removes it from your backpack.
This means if you have an item equipped, you can pick up a second item, since the number of stuff in your backpack is zero.

Is there a simple way to fix this?

It’s really easy to fix it, when you equip a tool it will be parented to player character, so just change to this:

if pUp.powerUpType.Value == "Weapon" and #plr.Backpack:GetChildren() == 0 and not plr.Character:FindFirstChildOfClass("Tool") then