-- Resizes a model to the specified scale

local function scaleModel(model, scale)	
	local primary = model.PrimaryPart
	local primaryCf = primary.CFrame
	
	for _,v in pairs(model:GetDescendants()) do
		if (v:IsA("BasePart")) then
			v.Size = (v.Size * scale)
			if (v ~= primary) then
				v.CFrame = (primaryCf + (primaryCf:inverse() * v.Position * scale))
			end
		end
	end
	
	return model
end
