Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Checking if my folder is empty or something is inside?

i just need a little code to check if my "GegnerStorage" folder is empty.

i tried this but it didnt work.

if game.workspace.GegnerStorage == nil then 
		status.Value = "You Won!"
		break

1 comment

0

Try #game.workspace.GegnerStorage:GetChildren() == 0 then

1 answer

Well if the folder is empty, it would still exist. You just need to check the number of children it has inside (0 if it's empty).

GetChildren returns a list of all the children, and the # operator will tell you the number of items in a list. So you can just check if #GegnerStorage:GetChildren() equals 0.

1 comment

0

Thanks very much! works now

This discussion is preserved as it was. New answers, comments, and votes are closed.