All pastes #914556 Raw Edit

GetMass(object)

public lua v1 · immutable
#914556 ·published 2008-02-22 23:52 UTC
rendered paste body
function GetMass(object) 	local check = {"Part","SpawnLocation","FlagStand","Seat"}	local mass = 0 	for n = 1, #check do		if object.className == check[n]			mass = mass + object:GetMass() 		end 	end	local c = object:GetChildren()	for i = 1, #c do 		for n = 1,#check do			if c[i].className == check[n] then				mass = mass + c[i]:GetMass() 			else 				mass = mass + GetMass(c[i]) 			end		end	end 	return massend