So, I want to do an inventory. I have the most brilliant way to do it but, the way I am doing this requires a check to see if a slot has a child. I want to use an in pairs loop. So, how would I see if it has a child? I tried, if slot:GetChildren() == nil then , but that doesn't seem to work. Any help will be appreciated!!
✓ ANSWER ACCEPTED
How to see if something has children?
1 answer
✓ Accepted answer
# Operator
for example:
model = workspace.Model --model in workspace
children = model:GetChildren() --getting children
if #children == 0 then --checking if number of children is equal to 0
print(no children!) --or whatever you want here
end --ending the if statement
http://wiki.roblox.com/index.php?title=Table#More_information
This discussion is preserved as it was. New answers, comments, and votes are closed.
