Hello, is it possible to make a folder have its max items? Like that in a specific folder there would be only able to store 4 items in there? If yes, how to do it?
Thank you.
Hello, is it possible to make a folder have its max items? Like that in a specific folder there would be only able to store 4 items in there? If yes, how to do it?
Thank you.
You can check the amount of objects inside the folder before adding anything
local folder = pathtofolder
if #folder:GetChildren() == 4 then return end
Now you put that inside your function that adds the items If this helped mark it as correct.
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
Thank you, but that doesn't work for me, I want to make it that it would't be possible to store more than 4 items in the folder.
That's why you check before adding any object inside of it
Oh, yea you were right, but for some reason it does it for 6 items not for 4 :/
instead of going through the folder every time. You could store a int value that has a value of 0. Then every time you store something in the folder add 1 to that value. Then before you store something in the folder just say folder:FindFirstChild(“theintvaluesname”) and if it’s value is 4 then don’t store anything.
Thank you, and the if it’s value is 4 then don’t store anything -- You mean return end?