I know how to do it to a part but how do I do it to a model..?
✓ ANSWER ACCEPTED
How to :GetMass() of a model?
1 answer
✓ Accepted answer
function GetMassOfModel(model)
local mass = 0
for i, v in pairs(model:GetChildren()) do
if v:IsA('BasePart') or v:IsA('Union') then
mass = mass + v:GetMass()
end
end
return mass
end
Something like that; When this function is called on a model (as the argument), it iterates through each object in the model specified, checks if it's a physical object, and then adds that object's mass into a total (the mass variable), returning the variable when it's done iterating.
This discussion is preserved as it was. New answers, comments, and votes are closed.

11 comments
You made a small mistake. Remove the return statement out of the loop.
orite
What does the i and the v mean in your script? I wanna know so I can script better!
Read this: http://wiki.roblox.com/index.php?title=For_loop#For
Replace IsA("Part") with IsA("BasePart"), that way it'll get the mass of wedges, balls, and other base parts as well.
right, forgot
Aren't Unions also a basepart?
poor drew
no, they are UnionOperations
pretty sure Union works as an abbreviation
They are UnionOperations, but they extend BasePart anyway.