Roblox gives false error message

When you specify a range (1,#children) for math.random, the range will be from 1 to the value of #children. When you put in an empty folder, you will get an error because there is nothing between 1 and #children. You will have to change math.random to (1,#children+1) if you want the range to start at 1 and include the value of #children.

1 Like