How to check how many items are in a players inventory?

How would I be able to check how many items are in a players inventory I want to know this so I can make it in my game that you can’t have more than 3 items at once

1 Like

Are you talking about the player’s backpack? Or a dictionary/table that represents the player’s inventory?

1 Like

Something like this:

local tools = game.Players.PlayerExample.Backpack:GetChildren()
print(#tools)
--#tools prints out how many children are there in the backpack.
1 Like

yeah
(30 words r-e-q-u-i-r-e-m-e-n-t-)

1 Like

Okay I will try this
(30 words requirements)

It worked! thank you so much!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.