Hello, the player backpack isnt updating. An example:
I have the following code in a part with a click detector. On clicking, it prints the number of tools in the character's backpack (twice, due to the new console). However, if i change the tools in the backpack (destroying it, for example), it keeps printing the same amount.
`
script.Parent.ClickDetector.MouseClick:connect(function(player)
local bp = game.Players:FindFirstChild(player.Name).Backpack:GetChildren()
print(#bp)
end)
`

5 comments
Could you give us more details? Screenshots, etc?
Sure! this is the part with the script: https://ibb.co/bNS3Ae (more images incoming)
as you can see, i have 12 elements in the backpack. When clicking, the console outputs 12, which is correct: https://ibb.co/kpQ6Ve (last image incoming)
but if i destroy something and click again, it keeps printing the same amount: https://ibb.co/nQkUiz
This isn't a solution but - use Connect instead of connect, and also you can say player.Backpack instead of the whole game.Players:FindFirstChild because player is passed in as an argument when the MouseClick event is fired.