So for example i need to check if there's a certain value inside a part in order to fulfill the if condition inside a script. How do i do it?
COMMUNITY QUESTION
How do i check if there is a certain object inside another one?
1 answer
There's an :IsA() function for every object in Roblox.
Go through the children and check if the object you're looking at is the object type you're looking for
For example, if you're looking for all the parts inside of a model:
for _, child in ipairs(game.Workspace.Model:GetChildren()) do
if(child:IsA("BasePart"))then
print(child)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Hi, you've been online since I last posted, but you seem to not have the question answered. Do you still need this answer to be answered or does the code above work?